title: What is the best way to use two keys with a std::map?
body: <p>I have a <code>std::map</code> that I'm using to store values for x and y coordinates. My data is very sparse, so I don't want to use arrays or vectors, which would result in a massive waste of memory. My data ranges from -250000 to 250000, but I'll only have a few thousand points at the most.</p>
  <p>Currently I'm creating a <code>std::string</code> with the two coordinates (i.e. <code>&quot;12x45&quot;</code>) and using it as a key. This doesn't seem like the best way to do it.</p>
  <p>My other thoughts were to use an int64 and shove the two int32s into it and use it as a key.</p>
  <p>Or to use a class with the two coordinates. What are the requirements on a class that is to be used as the key?</p>
  <p>What is the best way to do this? I'd rather not use a map of maps.</p>