title: C++ Member Initialization List
body: <p>Please explain how to use member initialization lists.
  I have a class declared in a <code>.h</code> file and a <code>.cpp</code> file like this:</p>
  
  <pre><code>class Example
  {
  private:
      int m_top;
      const int m_size;
      ...
  public:
      Example ( int size, int grow_by = 1 ) : m_size(5), m_top(-1);
      ...
      ~Example();
  };
  </code></pre>
  
  <p>I'm initializing <code>m_size</code> on object creation because of <code>const</code>. How should I write the constructor? 
  Should I repeat <code>: m_size(5), m_top(-1)</code>, or I can omit this step?</p>
  
  <pre><code>Example::Example( int size, int grow_by)
  {
  ... some code here
  }
  </code></pre>
  
  <p>or </p>
  
  <pre><code>Example::Example( int size, int grow_by) : m_size(5), m_top(-1)
  {
  ... some code here
  }
  </code></pre>