title: Const-correctness in matrix example
body: <p>I have a matrix class that use <code>std::vector</code> of <code>std::vector</code>'s inside.
  I want to allow using <code>matrix[i][j]</code> syntax but not explode std::vector in interface so I have created a Row class.</p>
  
  <pre><code>template &lt;typename T&gt;
  class Row {
  public:
      explicit Row(std::vector&lt;T&gt;&amp; value): value(value) {
  
      }
  
      T&amp; operator [] (size_t index) {
          return value[index];
      }
  
  private:
      std::vector&lt;T&gt;&amp; value;
  };
  
  template &lt;typename T&gt;
  class Matrix {
  public:
      Matrix(std::size_t n, std::size_t m, const T&amp; value = T()): value(n, std::vector&lt;T&gt;(m, value)) {
  
      }
  
      // irrelevant functions
  
      Row&lt;T&gt; operator [] (size_t index) {
          return Row(value[index]);
      }
  
  private:
      std::vector&lt;std::vector&lt;T&gt;&gt; value;
  };
  </code></pre>
  
  <p>Everything is fine until I want to work with const Matrix. If I have a const Matrix, I can't create <code>Row</code> because I only have <code>const operator []</code> of outer vector (and so only <code>const vector&lt;T&gt;&amp;</code>) and if I change <code>Row</code> ctor argument to <code>const vector&lt;T&gt;&amp;</code> I'll not be able to return T&amp;.</p>
  
  <p>I know I can create a class ConstRow that will have absolutely same functionality except that it'll get/return const refs but is it possible to workaround this nicely without creating a new class?</p>