title: std::unordered_map pass by reference
body: <p>I usually code in C. Now moving to C++. I have a <code>std::unordered_map</code> with 60 million entries. It is loaded once only and would not be modified later. I would like to pass it to some functions from time to time. But this code would copy the hash map every time:</p>
  
  <pre><code>typedef unordered_map&lt;uint64_t, mer*&gt; mer_map;
  void test_pass_by_ref3(mer_map kmers) {
  }
  
  void test_pass_by_ref2(mer_map kmers) {
      test_pass_by_ref3(kmers);
  }
  
  void test_pass_by_ref(mer_map kmers) {
      test_pass_by_ref2(kmers);
  }
  </code></pre>
  
  <p>If I want to pass the <code>pointer</code> only, how to pass it and query it as usual: <code>value = mer_map[key]</code>? I searched and find the <code>passing by reference</code> syntax:</p>
  
  <pre><code>void foo(const ClassName &amp;name)
  {
      ClassName&amp; temp = const_cast&lt;ClassName&amp;&gt;(name);
      ... ....
  }
  </code></pre>
  
  <p>But it seems cannot compiled. Please help. Thanks.</p>