title: Vector of pointers to struct
body: <p>Following program looks pretty OK to me. But I can not get it compiled.  </p>
  
  <pre><code>#include    &lt;iostream&gt;
  #include    &lt;vector&gt;
  using namespace std;
  
  int main()
  {
      struct a
      {
          int i;
          int j;
      };
  
  
      std::vector&lt;a*&gt; vecA;
  
      a* pA = new a;
  
      pA-&gt;i = 4;
      pA-&gt;j = 9;
  
      vecA.push_back(pA);
  
      return 0;
  }
  </code></pre>
  
  <p>It generates following error.</p>
  
  <pre><code>struct_update.cc: In function ‘int main()’:
  struct_update.cc:32:19: error: template argument for ‘template&lt;class _Alloc&gt; class std::allocator’ uses local type ‘main()::a*’
  struct_update.cc:32:19: error:   trying to instantiate ‘template&lt;class _Alloc&gt; class std::allocator’
  struct_update.cc:32:19: error: template argument 2 is invalid
  struct_update.cc:32:25: error: invalid type in declaration before ‘;’ token
  struct_update.cc:39:10: error: request for member ‘push_back’ in ‘vecA’, which is of non-class type ‘int’
  </code></pre>