title: Unordered map with multiple values
body: <p>So I have an unordered map, and for each key I want to store two unique floats. These floats represent aggregate values over time of something I am simulating, and thus as my code progresses they values of existing keys may be added to, and new keys may be created. </p>
  
  <p>Previously I was only tracking one value, and so an unordered map was the easy solution. I am not sure how to save two distinct values with one key though? </p>
  
  <ul>
  <li>Using an <code>unordered_map&lt;int,vector&lt;float&gt; &gt;</code> was my first thought, but then adding to existing values isn't as easy. It seems I must determine if a key exists first, and then either add the new vector component-wise to the existing one or set the key equal to the new vector. </li>
  <li>I looked at unordered_multimap. Although I didn't get a great feel for how it works, it didn't seem to offer a good way to track which of the values is which, given that I have two values that I want to keep separate and be able to determine which is which. </li>
  </ul>
  
  <p>Is there another way to go about this? </p>
  
  <hr>
  
  <p>Using <code>unordered_map&lt;int,pair&lt;float,float&gt; &gt;</code> was an easy solution. </p>