title: What are the advantages of a map of maps vs a std::pair as a key
body: <p>What are the advantages and disadvantages of the following ways of making a map that is intended to represent a two dimensional grid. The grid should be able to be filled in at any point, without allocating memory for the whole thing, which is why I didn't just use a 2d array.</p>
  
  <pre><code>std::map&lt;int, std::map&lt;int, Tile*&gt;* &gt;* tiles;
  
  std::map&lt;std::pair&lt;int, int&gt;, Tile*&gt;* tiles;
  </code></pre>
  
  <p>Or if you have another better idea let me know. I'm sorry if this is a question that gets asked alot.</p>