title: what is a good place to put a const in the following C++ statement
body: <p>Consider the following class member:</p>
  
  <pre><code>std::vector&lt;sim_mob::Lane *&gt;  IncomingLanes_;
  </code></pre>
  
  <p>the above container shall store the pointer to some if  my Lane objects. I don't want the subroutins using this variable as argument, to be able to modify Lane objects.
  At the same time, I don't know where to put 'const' keyword that does not stop me from populating the container.</p>
  
  <p>could you please help me with this?</p>
  
  <p>thank you and regards
  vahid</p>
  
  <p><strong>Edit:</strong>
  Based on the answers i got so far(Many Thanks to them all) Suppose this sample:</p>
  
  <pre><code>#include &lt;vector&gt;
  #include&lt;iostream&gt;
  using namespace std;
  
  class Lane
  {
  private:
      int a;
  public:
      Lane(int h):a(h){}
      void setA(int a_)
      {
          a=a_;
      }
      void printLane()
      {
          std::cout &lt;&lt; a &lt;&lt; std::endl;
      }
  };
  
  class B
  {
  
  public:
      vector&lt; Lane const  *&gt; IncomingLanes;
      void addLane(Lane  *l)
      {
          IncomingLanes.push_back(l);
      }
  
  };
  
  int main()
  {
      Lane l1(1);
      Lane l2(2);
      B b;
      b.addLane(&amp;l1);
      b.addLane(&amp;l2);
      b.IncomingLanes.at(1)-&gt;printLane();
      b.IncomingLanes.at(1)-&gt;setA(12);
      return 1;
  }
  </code></pre>
  
  <p>What I meant was: </p>
  
  <blockquote>
    <p>b.IncomingLanes.at(1)->printLane()</p>
  </blockquote>
  
  <p>should work on IncomingLanes with no problem   AND</p>
  
  <blockquote>
    <p>b.IncomingLanes.at(1)->setA(12)</p>
  </blockquote>
  
  <p>should not be allowed.(In th above example none of the two mentioned methods work!)</p>
  
  <p>Beside solving the problem, I am loking for good programming practice also. So if you think there is a solution to the above problem but in a bad way, plase let us all know.
  Thaks agian</p>