title: Constructor initialization
body: <p>I am reading &quot;Accelerated C++&quot; by Andrew Koenig and Barbara E. Moo, and I'm at the chapter about constructors (5.1).</p>
  <p>They mention here that</p>
  <blockquote>
  <p>We said that constructors exist to ensure that objects are created with their data members in a sensible state. In general, this design goal means that every constructor should initialize every data member. The need to give members a value is especially critical for members of built-in type. ...</p>
  <p>Although we explicityly initialized only <code>midterm</code> and <code>final</code>, the other data members are initialized implicitly. Specifically, <code>n</code> is initialized by the <code>string</code> default constructor, and <code>homework</code> is initialized by the <code>vector</code> default constructor.</p>
  </blockquote>
  <p>The class they are talking about is</p>
  <pre><code>class Student_info {
  public:
      std::string name() const (return n;}
      bool valid() const {return !homework.empty();}
      std::istream&amp; read(std::istream&amp;);
  
      double grade() const;
  private:
      std::string n;
      double midterm, final;
      std::vector&lt;double&gt; homework;
  };
  </code></pre>
  <p>and their default constructor is</p>
  <pre><code>Student_info::Student_info(): midterm(0), final(0) {}
  </code></pre>
  <p>I would just like to clarify that this means that things like <code>int</code> and <code>double</code> where there isn't a <code>std::</code> before the term will need to be initialized specifically?</p>