title: Is it faster to lookup in set than unordered_map
body: <p>I have a question about lookup speed. I want to know <strong>which STL container can produce the fastest lookup time in C++</strong>. <code>unordered_map</code> comes to my mind since it is implemented by hash map, but I am afraid its performance is penalized because it contains key-value pair, whereas <code>set</code> contains only key. I guess the answer will depends on 1) the data type of key; and 2) the STL implementation of <code>set</code>. </p>
  
  <p>In other words, which container is faster to search for the existence of an key, is it set, unordered_map, or something else?</p>
  
  <h1>Edit:</h1>
  
  <p>Would appreciate the answer with more explanation on the implementation or mechanism of the container. For instance, unordered_map is fast because it's implemented with hashmap. That will be more helpful than saying "it depends on the need". Thanks!</p>