title: Vector of const objects giving compile error
body: <p>I have declared the following in my code</p>
  
  <pre><code>vector &lt;const A&gt; mylist; 
  </code></pre>
  
  <p>I get the following compile error - </p>
  
  <pre><code>new_allocator.h:75: error: `const _Tp* __gnu_cxx::new_allocator&lt;_Tp&gt;::address(const _Tp&amp;) const \[with _Tp = const A]' and `_Tp* __gnu_cxx::new_allocator&lt;_Tp&gt;::address(_Tp&amp;) const [with _Tp = const A]' cannot be overloaded
  </code></pre>
  
  <p>But if declare - </p>
  
  <pre><code>vector &lt;A&gt; mylist;
  </code></pre>
  
  <p>my code compiles.</p>
  
  <p>Is const not allowed in this context?</p>
  
  <p>I am copying my code here for everyone'e reference - </p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;vector&gt;
  
  using namespace std;
  class A
  {
  public:
      A () {cout &lt;&lt; "default constructor\n";}
      A (int i): m(i) {cout &lt;&lt; "non-default constructor\n";}
  
  private:
      int m;
  };
  
  int main (void)
  {
      vector&lt;const A&gt; mylist;
  
      mylist.push_back(1);
  
      return 0;
  }
  </code></pre>