title: About initializing a vector in C++ with { }
body: <p>In Stroustrup's book, "Programming: Principles and Practices of Programming Using C++ (Second Edition)", the author creates three vectors as followed in their own struct:</p>
  
  <pre><code>struct Day {
      vector&lt;double&gt; hour{ vector&lt;double&gt;(24,not_a_reading) };
  };
  
  struct Month { // a month of temperature readings
      int month{ not_a_month }; // [0:11] January is 0
      vector&lt;Day&gt; day{ 32 }; // [1:31] one vector of readings per day
  };
  
  struct Year { // a year of temperature readings, organized by month
      int year; // positive == A.D.
      vector&lt;Month&gt; month{ 12 }; // [0:11] January is 0
  };
  </code></pre>
  
  <p>My question is, why does <code>vector&lt;Day&gt; day{32};</code> create a vector of type Day with a size of 32, whereas <code>vector&lt;int&gt;{32};</code> creates a vector of size 1?</p>