title: How to initialize unordered_map directly with fixed element?
body: <p>I want to initialize one <code>unordered_map</code> with fixed element 100. And the <code>keys</code> are from <code>0</code> to <code>100</code>, all values of those keys are <code>0</code> </p>
  
  <pre><code>using HashMap = unordered_map &lt; int, int &gt; ;
  
  HashMap map;
  for (int idx = 0; idx &lt; 100; ++idx) {
      map[idx] = 0;
  }
  </code></pre>
  
  <p><strong>Question 1:</strong></p>
  
  <p>Is there any directly way to do that like the following codes in <code>python</code>?</p>
  
  <pre><code>d = {x: x % 2 == 0 for x in range(1, 11)}
  </code></pre>
  
  <p><strong>Question 2:</strong></p>
  
  <p>With initialization codes above, I think all elements are sorted in ascending order, but the results are:</p>
  
  <p><img src="https://i.stack.imgur.com/I1frF.png" alt="enter image description here">  </p>
  
  <p>Why the first element is <code>8</code> and the second element is <code>64</code>, all left elements are in ascending order?</p>