title: C++ vector of vectors
body: <p>I am trying to write a program that uses a base class to define an algorithm for solving a simple problem. I use a vector of ints as a 'game board'. My question is how can I create a function get_moves that returns a vector of game boards?</p>
  
  <p>Here is the code I have for the function:</p>
  
  <pre><code>std::vector&lt; &lt;std::vector&lt;int&gt; &gt; takeaway::generateMoves( std::vector&lt;int&gt; currBoard ) {
  
  
      if( currBoard[0] == 1 || currBoard[0] == 2 ) {
         moves.push_back( 1 );
      }
      else if( currBoard[0] == 3 ) {
         moves.push_back( 2 );
      }
      else if( currBoard[0] == 4 ) {
         moves.push_back( 3 );
      }
      else {
        moves.push_back( 1 );
        moves.push_back( 2 );
        moves.push_back( 3 );
      }
  
      std::vector&lt; &lt;std::vector &lt;int &gt; &gt; toReturn( moves );
  
       for( int i = 0; i &lt; moves.size(); i++ ) {
  
        std::cout &lt;&lt; "MOVES: " &lt;&lt; moves[i] &lt;&lt; std::endl;
      }
  
    return toReturn;
  </code></pre>
  
  <p>The errors that I get are:</p>
  
  <p>takeaway.cpp:55: error: template argument 1 is invalid
  takeaway.cpp:55: error: template argument 2 is invalid</p>
  
  <p>So my question is how can I properly create and return a vector of vectors?</p>