title: Are C++ recursive type definitions possible, in particular can I put a vector<T> within the definition of T?
body: <p>For one of my projects, what I really wanted to do was this (simplifying it to the bare minimum);</p>
  
  <pre><code>struct Move
  {
      int src;
      int dst;
  };
  
  struct MoveTree
  {
      Move move;
      std::vector&lt;MoveTree&gt; variation;
  };
  </code></pre>
  
  <p>I must admit that I assumed that it wouldn't be possible to do this directly, I thought a vector of MoveTree s within a MoveTree would be verboten. But I tried it anyway, and it works beautifully. I am using Microsoft Visual Studio 2010 Express.</p>
  
  <p>Is this portable ? Is it good practise ? Do I have anything to worry about ?</p>
  
  <p>Edit: I've asked a second <a href="https://stackoverflow.com/questions/6527917/how-can-i-emulate-recursive-a-type-definition-in-c">question</a> hoping to find a good way of doing this.</p>