title: How to use std::unordered_map::insert_or_assign
body: <p>How do I implement the std::unordered_map::insert_or_assign method?</p>
  
  <p>Document: <a href="https://en.cppreference.com/w/cpp/container/unordered_map/insert_or_assign" rel="nofollow noreferrer">https://en.cppreference.com/w/cpp/container/unordered_map/insert_or_assign</a></p>
  
  <p><strong><em>Parameters:</em></strong> </p>
  
  <p><strong><em>k</em></strong> -   the key used both to look up and to insert if not found  </p>
  
  <p><strong><em>hint</em></strong>  -   iterator to the position before which the new element will be 
                  inserted  </p>
  
  <p><strong><em>obj</em></strong>   -   the value to insert or assign  </p>
  
  <p>I am confused as to what hint is suppose to be?</p>
  
  <p>I create a came_from unordered map with Coord classes. (I believe the Coord class is irrelevant here, but if you find necessary, comment, then I will show code). What is the hint parameter suppose to be in this situation? </p>
  
  <pre><code>unordered_map&lt;Coord, Coord&gt;&amp; came_from;
  
  Coord start = Coord(0,0);
  Coord goal = Coord(1,1);
  came_from.insert_or_assign(start, "What is suppose to be here", goal);
  </code></pre>