title: vector of user defined type
body: <p>When trying to compile this code:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;vector&gt;
  using namespace std;
  
  class Test {
      int a;
  
  public:
      Test(int pa) : a(pa) { }
  
      void print() {
          std::cout &lt;&lt; a &lt;&lt; std::endl;
      }
  };
  
  int main() {
  
      Test t(31415);
  
      t.print();
  
      vector&lt;Test &amp;&gt; vet;
  
      vet.push_back(&amp;t);
  
      return 0;
  }
  </code></pre>
  
  <p>gcc 4.4.5-8 report various erros, starting with: </p>
  
  <pre><code>In file included from /usr/include/c++/4.4/i486-linux-gnu/bits/c++allocator.h:34,
                   from /usr/include/c++/4.4/bits/allocator.h:48,
                   from /usr/include/c++/4.4/string:43,
                   from /usr/include/c++/4.4/bits/locale_classes.h:42,
                   from /usr/include/c++/4.4/bits/ios_base.h:43,
                   from /usr/include/c++/4.4/ios:43,
                   from /usr/include/c++/4.4/ostream:40,
                   from /usr/include/c++/4.4/iostream:40,
                   from references.cpp:1:
  /usr/include/c++/4.4/ext/new_allocator.h: In instantiation of ‘__gnu_cxx::new_allocator&lt;Test&amp;&gt;’:
  /usr/include/c++/4.4/bits/allocator.h:87:   instantiated from ‘std::allocator&lt;Test&amp;&gt;’
  /usr/include/c++/4.4/bits/stl_vector.h:71:   instantiated from ‘std::_Vector_base&lt;Test&amp;, std::allocator&lt;Test&amp;&gt; &gt;’
  /usr/include/c++/4.4/bits/stl_vector.h:171:   instantiated from ‘std::vector&lt;Test&amp;, std::allocator&lt;Test&amp;&gt; &gt;’
  references.cpp:22:   instantiated from here
  ...
  </code></pre>
  
  <p>where is the error?</p>