title: C++ equivalent to Java Map getOrDefault?
body: <p>Java's getOrDefault was a nice construct for one line access to a map value or the starting point if one does not exist.  I do not see anything in the map reference in C++ with a parallel.  Does something exist or is it build your own?  </p>
  
  <p>I have objects in the map that I would update if they exist, but construct new if they do not. With getOrDefault, I could construct the object on the default side, or access it if it exists. </p>
  
  <p><a href="http://www.cplusplus.com/reference/map/map/" rel="noreferrer">http://www.cplusplus.com/reference/map/map/</a></p>
  
  <p><a href="https://www.geeksforgeeks.org/hashmap-getordefaultkey-defaultvalue-method-in-java-with-examples/" rel="noreferrer">https://www.geeksforgeeks.org/hashmap-getordefaultkey-defaultvalue-method-in-java-with-examples/</a></p>