title: How to resolve compilation error "cannot convert const to reference" in VC++9
body: <p>I am working in migration project from VC6 to VC9. In VC9 (Visual Studio 2008), I got compilation error while passing const member to a method which is accepting reference. It is getting compiled without error in VC6.</p>
  
  <p>Sample Program:</p>
  
  <pre><code>class A
  {
  };
  
  typedef CList&lt;A, A&amp;&gt; CAlist;
  
  class B
  {
      CAlist m_Alist;
  
  public:
      const B&amp; operator=( const B&amp; Src);
  };
  
  const B&amp; B::operator=( const B&amp; Src)
  {
      POSITION pos = Src.m_Alist.GetHeadPosition();
  
      while( pos != NULL)
      {
          **m_Alist.AddTail( Src.m_Alist.GetNext(pos) );**
      }
  
      return *this;
  }
  </code></pre>
  
  <p>Error:
  Whiling compiling above program, I got error as</p>
  
  <blockquote>
    <p>error C2664: 'POSITION CList::AddTail(ARG_TYPE)' : cannot convert parameter 1 from 'const A' to 'A &amp;'</p>
  </blockquote>
  
  <p>Please help me to resolve this error.</p>