title: BOOST_AUTO And C++ User Defined Type
body: <p>I'm new to BOOST_AUTO and here is a basic question.</p>
  
  <p>I defined my own class and used it with BOOST_AUTO. According to the tutorial:</p>
  
  <blockquote>
    <p>If your define your own type, the Typeof Library cannot handle it
    unless you let it know about this type. You tell the Typeof Library
    about a type (or template) by the means of "registering" this
    type/template.</p>
  </blockquote>
  
  <p>But my code below doesn't register anything and runs correctly in VC++2010. Is this registration really necessary. Did I do anything wrong?</p>
  
  <pre><code>#include &lt;boost/typeof/typeof.hpp&gt;
  using namespace std;
  namespace NS1 {
      struct X {
          X(const X&amp; x){s=x.s+1;}
          X(){s=3;}
          int s;
      };
  }
  int _tmain(int argc, _TCHAR* argv[])
  {
      NS1::X x;
      BOOST_AUTO(y,x);
  
      cout &lt;&lt; y.s &lt;&lt; endl;
      return 0;
  }
  </code></pre>
  
  <blockquote>
    <p>output:4</p>
  </blockquote>