C++ Programming - Member Initialization Lists

The choice between using a mem-initialization list and initialization inside the constructor's body is significant in the following four cases:

*Initialization of const members
*Initialization of reference members
*Passing arguments to a constructor of a base class or an embedded object
*Initialization of member objects

In the first three cases, a mem-initialization list is mandatory; in the fourth case, it is optional.

The Order Of A Mem-Initialization List Must Match The Order Of Class Member Declarations


About this entry