title: keys not unique in c++ map
body: <p>I have a std::map in my program which stores pairs of values. I want the keys in the map to be unique - which is the expected behavior of a std::map class. But when I insert the pairs into it, some keys are repeated. How do I solve this problem?</p>
  
  <p>My code is as follows:</p>
  
  <pre><code>map&lt;float,vector&lt;float&gt; *&gt; inpDataMap;
  inpDataMap.clear();
      for(int i = 0; i &lt; input.getNum(); i++)
      {
  
          float xVal = input[i][0];
          float yVal = input[i][1];
  
          if(inpDataMap.count(xVal) &gt; 0)
          {
              myfile &lt;&lt; i &lt;&lt; " repeated xval: " &lt;&lt; xVal &lt;&lt; " : " &lt;&lt; yVal &lt;&lt; endl;
              inpDataMap[xVal]-&gt;push_back(yVal);
              myfile &lt;&lt; "repeated value pushed" &lt;&lt; endl;
          }
          else
          {
              vector&lt;float&gt; *inVec = new vector&lt;float&gt;;
              inVec-&gt;push_back(yVal);
              inpDataMap[xVal] = inVec;
              myfile &lt;&lt; i &lt;&lt; " not repeated:" &lt;&lt; xVal &lt;&lt; ":" &lt;&lt; yVal &lt;&lt; endl;
          }
  
      }
  </code></pre>
  
  <p>As you can see that the map I have here is actually an association of a float and a vector of associated floats. If there's already a key existing, the value is added to the vector corresponding to that key. But like I said, the keys are not stored uniquely. Can anybody help me to solve this problem?</p>
  
  <p>Rakesh.</p>