const_cast for vector with object
<p>I understand that const_cast to remove constness of objects is bad, </p>

<p>I have the following use case, </p>

<pre><code>//note I cannot remove constness in the foo function
foo(const std::vector&lt;Object&gt; &amp; objectVec) {

   ...
   int size = (int) objectVec.size();
   std::vector&lt;Object&gt; tempObjectVec;
   //Indexing here is to just show a part of the vector being
   //modified
   for (int i=0; i &lt; (int) size-5; ++i) {
       Object &amp;a = const_cast&lt;Object&amp;&gt; objectVec[i];
       tempObjectVec.push_back(a);
   } 
   foo1(tempObjectVec);
}
</code></pre>

<p>If i change tempObjectVec objects in foo1, will the original objects in ObjectVec change, I say yes since I am passing references, further is this efficient. Can you suggest alternatives. </p>
