title: cannot convert parameter 1 from 'std::_Vector_iterator<_Myvec>' to 'std::_Vector_iterator<_Myvec>'
body: <p>I have a question, its a bit hard to discribe it so be easy on me please.</p>
  
  <p>I have two classes, A and B, class A have a private member- vector:</p>
  
  <pre><code>class A
  {
  private:
      struct complex
      {
         int x;
         vector&lt; int &gt; y;
      };
  
      vector&lt; complex &gt; m_resultVector; // &lt;---- the private member
  
  public:
      void getPointerToVector( vector&lt; complex &gt;::iterator it )
      {
          it = m_resultVector.begin();
      }
  };
  </code></pre>
  
  <p>I need to get access (only read) from class B, to this <code>m_resultVector;</code>, I could write a <code>get</code> function but <code>m_resultVector</code> is very long vector and I don't want to copy the entire vector to a new one, I want to send its pointer. also the important part- I need class B cannot change the content of <code>m_resultVector</code></p>
  
  <pre><code>class B
  {
      struct complex
      {
          int x;
          vector&lt; int &gt; y;
      };
  
      void functionOf_B()
      {
          A class_A;
          vector&lt; complex &gt;::iterator p_resultVector;
  
          class_A.getPointerToVector(p_resultVector); // &lt;------ compilation error here
  
          // some reading from the content of p_resultVector
      }
  };
  </code></pre>
  
  <p>when I try to compile it, I get the error:</p>
  
  <blockquote>
    <p>cannot convert parameter 1 from 'std::_Vector_iterator&lt;_Myvec>' to
    'std::_Vector_iterator&lt;_Myvec>'</p>
  </blockquote>
  
  <p>so basically, I have to questions-</p>
  
  <ol>
  <li>why do I get this error? the <code>complex</code> struct is defined in both classes.</li>
  <li>where and how do I need to declare on <code>const iterator</code> on class B, so it will be read only? I'm not sure ...</li>
  </ol>