title: 3 keys ordered map in C++
body: <p>I have a 3 component vector struct called <code>Vector3</code> with 3 <code>int</code> representing X, Y and Z. For each 3D point (I have more or less 200-300 different 3D points) I have a <code>string</code>.</p>
  
  <p>What I want to do is to have a data structure that checks if there is a <code>string</code> for that location. I wanted to use a <code>std::map</code> and I made this code without good results:</p>
  
  <p>The error it has is that It just runs the <code>else</code> part once, and keeps returning the same <code>string</code> over and over.</p>
  
  <p>My <code>Vector3</code> class is the one in Ogre3D: <a href="http://www.ogre3d.org/docs/api/html/classOgre_1_1Vector3.html" rel="nofollow">http://www.ogre3d.org/docs/api/html/classOgre_1_1Vector3.html</a></p>
  
  <pre><code>String WorldGenerator::createPlatformBorder(Vector3 size)
  {
      static std::map&lt;Vector3, String&gt; generatedBorders;
  
      if (generatedBorders.find(size) != generatedBorders.end())
      {
          return generatedBorders[size];
      }
      else
      {
          String blockName = requestNewPlatformBorderName();
          generatedBorders.insert(std::pair&lt;Vector3, String&gt;(size, blockName));
          // some logic
          return blockName;
      }
  }
  </code></pre>
  
  <p>Could you help me out, please?</p>
  
  <p>Note that the function <code>requestNewPlatformBorderName()</code> works perfectly fine, so the bug isn't there. Here is the code for it:</p>
  
  <pre><code>String requestNewPlatformBorderName()
  {
      static int counter = 0;
      return StringConverter::toString(++counter) + "-platform-border";
  }
  </code></pre>