How do I add an object to a vector<const Obj&>?
<p>I am not sure why this doesn't compile:</p>

<pre><code>std::vector&lt; const Obj&amp; &gt; myVector;

void foo(const Obj&amp; obj) 
{
    myVector.push_back( obj );  
}  
</code></pre>

<p>Sorry, a bit of additional info on what I'm trying to achieve: I can't change the signature of foo without breaking an interface, but I just want to hang onto the Objects that get passed through foo.  I do want to store pointers to them, but I'm confused about the syntax of how to do that.</p>
