title: set default value of unordered map if key doesn't exist
body: <p>In my program I want that the default value, if a key doesn't exist in my unordered map, is going to be <code>std::numeric_limits&lt;double&gt;::max()</code> Instead of just 0.</p>
  <p>my code looks like the following:</p>
  <pre><code>class Pair
  {
  public:
     Graph::NodeId node;
     bitset&lt;64&gt; bits;
  
     Pair(Graph::NodeId node1, double bits1)
     {
         node = node1;
         bitset&lt;64&gt; temp(bits1);
         bits = temp;
     }
  
  };
  
  bool operator==(const Pair &amp;P1, const Pair &amp;P2)
  {
     return P1.node == P2.node &amp;&amp; P1.bits == P2.bits;
  }
  
  template &lt;&gt;
  struct std::hash&lt;Pair&gt;
  {
  std::size_t operator()(const Pair &amp;pair) const noexcept
  {
    std::hash&lt;decltype(pair.node)&gt; ihash;
    std::hash&lt;decltype(pair.bits)&gt; bhash;
    return ihash(pair.node) * 31 + bhash(pair.bits);
  }
  };
  
  unordered_map&lt;Pair, double&gt; lFunction;
  </code></pre>
  <p>so if I want to access the element <code>lFunction[Pair(3,3)]</code> and the key doesn't exist, there should be the value <code>std::numeric_limits&lt;double&gt;::max()</code>.</p>