title: How to create a Vector of Vectors of Objects of a Class
body: <p>I'm using Cocos 2d-x and I need to create a Vector of Objects of a Class, but I'm getting a Type Error when I try to create them like this:</p>
  
  <pre><code>header
  Vector&lt;Vector&lt;Level*&gt; &gt; _stagesLevelsVec;
  //Here's the type Error when I try to create a Vector of Vectors of Objects of Class Level
  //Error: Invalid Type for cocos2d::Vector&lt;T&gt;!
  //Last output line: see reference to class template instantiation 'cocos2d::Vector&lt;cocos2d::Vector&lt;Level *&gt;&gt;' being compiled
  </code></pre>
  
  <p>cpp</p>
  
  <pre><code>Level * level_0 = new Level; //I have to create an Object of Class Level
  level_0-&gt;setLevel(0); //I have to set a Property of the Object using a Method of the Class.
  
  Vector&lt;Level *&gt; allLevelsVec_0; //Here's the type Error when I try to create a Vector of Objects Level
  //Error: Invalid Type for cocos2d::Vector&lt;T&gt;!
  //Last output line: see reference to class template instantiation 'cocos2d::Vector&lt;Level *&gt;' being compiled
  
  allLevelsVec_0.pushBack(level_0); //I have to add the Object into the Vector
  _stagesLevelsVec.pushBack(allLevelsVec_0); //I have to add a Vector of Objets Level into a Vector
  
  //Then somewhere in code
  
  auto allLevelsVec = _stagesLevelsVec.at(0); // I have to get the Vector of Objects Level that I need
  auto level = allLevelsVec.at(0); //I have to get the Object Level
  auto levelId = level-&gt;getLevel(); //Finally I have to get the Property of level using a Method of the Class
  
  CCLOG("This is level: %i", levelId); //Output must be: This is level: 0.    
  </code></pre>
  
  <p>Thanks for any guideline on this matter. Greetings.</p>