title: std::find on an (unordered_)map
body: <p>For an unordered_map I have I want to do a reverse lookup (meaning to find the key given a value). One would expect this to be simple using std::find. I tried the following, which doesn't work:</p>
  
  <pre><code>#include &lt;unordered_map&gt;
  #include &lt;algorithm&gt;
  
  int main()
  {
      std::unordered_map&lt;int, int&gt;    map;
  
      auto iter = std::find(map.begin(), map.end(), [](const std::pair&lt;int, int&gt; &amp;pair) -&gt; bool {
          return pair.second == 4;
      }); 
  }
  </code></pre>
  
  <p>The compiler complains about an invalid binary expression, apparently it tries to compare the value to the predicate itself:</p>
  
  <blockquote>
    <p>/usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.0/../../../../include/c++/5.4.0/bits/predefined_ops.h:194:17: error: invalid operands to binary expression
          ('std::pair' and 'const (lambda at unordered_map.cpp:8:51)')
            { return *__it == _M_value; }</p>
  </blockquote>
  
  <p>What am I missing here? As far as I know, this should be a valid predicate to search the map.</p>