title: deleting a key- value pair from a map using value
body: <p>i want to delete a key-value pair from a map but my problem is that i have the value and not the key.
  How can i delete a key-value pair from the map using a "value".
  And the value what i have is unique in the map.</p>
  
  <p>my code snippet:</p>
  
  <pre><code>int Clientqueues::addClient(string ipaddress, string sessionid)
  {
      clientsWithNoLogin.insert(pair&lt;string,string&gt;(ipaddress,sessionid));
      return 0;
  }
  
  void Clientqueues::deleteClient(string sessionid)
  {
      map&lt;string, string&gt;::iterator i,current;
  
     for(i = clientsWithNoLogin.begin() ;i!= clientsWithNoLogin.end();)
     {
      current = i;
      ++i;
      if((current-&gt;second) == sessionid) clientsWithNoLogin.erase(current);
     }
     return ;
  }
  </code></pre>
  
  <p>will this delete the key-value pair??</p>