title: Is it safe to get an object in std::map by reference?
body: <p>I have a map like this</p>
  
  <pre><code>map&lt;int,object&gt; objmap;
  object&amp; obj = objmap.find(num)-&gt;second;
  object&amp; obj2 = objmap[num];
  </code></pre>
  
  <p>Whatever changes I make in the object have to be reflected on the map. Similar thing cant be done in a vector as it changes location of objects when it wants more space. Is it safe to do it in a std::map? and is it advisable? 
  The second version gives an error as my object doesn't have an empty constructor. If I declare an empty constructor doing nothing, will the two lines will work the same way?</p>