title: Initializing a vector of vectors of objects
body: <p>I'm having trouble creating a vector of vectors of objects.
  The goal is to get something like a chessboard, with each of the fields beeing an 
   object which can then be accessed by using the vector.</p>
  
  <pre><code>#include&lt;vector&gt;
  using namespace std;
  
  class raster;
  
  class field{
    int x, y;
  public:
    field(int x, int y) : x(x), y(y) {};
    friend class raster;
  };
  
  class raster{
    const size_t s=12;
    vector&lt;vector&lt;field&gt; &gt; game_row(s,vector&lt;field&gt;game_column(s,0)); //here I get the second error
  public:
    friend class field;
  };
  </code></pre>
  
  <p>So I want the vector of vectors to be a member of a different class, but each time I compile using g++ it says<br>
  error: 's' is not a type<br>
  error: expected ',' or '...' before '(' token</p>
  
  <p>Sorry if i mixed up the formatting of the post,<br>
  I'm pretty new to c++ and this is my first post here.</p>