title: How to read values from a 2D initializer_list and put them in a 2D vector
body: <p>I have a Matrix class which has to have a constructor that accepts an uninitialized list.
  The contstructor has to get the values and put them in a 2D vector, a matrix.</p>
  
  <p>This is my 2D vector.</p>
  
  <pre><code>vector&lt;vector&lt;double&gt;&gt; d_matrix;
  </code></pre>
  
  <p>This is my constructor.</p>
  
  <pre><code>Matrix::Matrix(initializer_list&lt;initializer_list&lt;int&gt;&gt; list)
  {
      d_row = list.size();
      d_col = (*list.begin()).size();
  
      initMatrix();
  
      for (size_t r = 0; r &lt; d_row; ++r)
      {
          for (size_t c = 0; c &lt; d_col; ++c)
          {
              /* I need to do something here */
              //d_matrix[r][c] = list.begin() + r) + c);
              //cout &lt;&lt; (*list.begin()).;
          }
      }
  }
  </code></pre>
  
  <p>This is my init Matrix function to start off with initial values.</p>
  
  <pre><code>void Matrix::initMatrix()
  {
      d_matrix.resize(d_col, vector&lt;double&gt;(d_row, 0)); 
  }
  </code></pre>
  
  <p>This is how I call my constructor.</p>
  
  <pre><code>Matrix m({ {1, 2, 3},
             {3, 4, 2} }
           );
  </code></pre>
  
  <p>I managed to obtain the dimensions of the list(d_row and d_col), however I am stuck with trying to extract the values out of the list, tried it with an insert aswell and both the iterators begin and end. The uninitialized list class only seems to have two iterator methods and a size method. I am using namespace <em>std</em> btw.</p>
  
  <p>The question is, how do I get the values out of the uninitialized list and store them into my 2D vector which I call d_matrix.</p>