title: Trying to insert User defined type of Vector into User defined type Vectors
body: <p>I'm trying to make a vector of vectors in a spell system for a small RPG battle simulation. The main goal I'm trying to accomplish is have a vector of Spells that the player can access and select what type of Spells they want to cast: Fire, Ice, etc. and then choose the name of the spell: burn, frost, etc.</p>
  
  <p>The code below is what I've declared Spell and FireSpell as. I'm trying to insert a vector of FireSpells into a vector of type vector spells, however, it does not insert.  Is there a way to make it insert?</p>
  
  <p>I've tried the push_back on a FireSpell into a vector of Spells and it works fine, however, it always returns an error when I push_back a FireSpell vector into a vector of type vector Spell. </p>
  
  <p>Magic.h</p>
  
  <pre><code>struct Fire
  {
      int damage;
      int dps;
  }; 
  
  struct Spell
  {
      int cost;
      string name;
  };
  
  struct FireSpell : Spell, Fire
  {
  
  };
  
  </code></pre>
  
  <p>Magic.cpp</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include "MagicSys.h"
  #include &lt;vector&gt;
  #include &lt;string&gt;
  #include "Magic.h"
  
  using std::cout;
  using std::vector;
  
  FireSpell burn;
  FireSpell inferno;
  FireSpell volcano;
  
  
  int mainfunc()
  {
      vector&lt;vector&lt;Spell&gt;&gt; PlayerSpells;
      vector&lt;FireSpell&gt; PlayerFSpells;
      PlayerFSpells.push_back(burn);
      PlayerFSpells.push_back(inferno);
      PlayerFSpells.push_back(volcano);
  
   /*Trying to insert FireSpell Vector into the end of the vector of Spell vectors*/
  
      PlayerSpells.push_back(PlayerFSpells);
  
      vector&lt;vector&lt;Spell&gt;&gt;::iterator it;
      for (it = PlayerSpells.begin(); it!=PlayerSpells.end(); ++it)
          cout &lt;&lt; &amp;it &lt;&lt; " ";
  
      return 0;
  }
  </code></pre>
  
  <p>I expected the inner FireSpell vector to insert into the outer Spell vector on the line: <code>PlayerSpells.push_back(PlayerFSpells);</code> , however, it gives me the error message:</p>
  
  <pre><code>no instance of overloaded function "std::vector&lt;_Ty, _Alloc&gt;::push_back
  [with _Ty=std::vector&lt;Spell, std::allocator&lt;Spell&gt;&gt;,
  _Alloc=std::allocator&lt;std::vector&lt;Spell, std::allocator&lt;Spell&gt;&gt;&gt;]"
  matches the argument list
  </code></pre>