(Command-line option to suppress warning: -w-obi)
Early versions of C++ provided for initialization of a base class by following the constructor header with just the base class constructor parameter list.
It is now recommended to include the base class name.
This makes the code much clearer, and is required when you have multiple base classes.
Old way
derived::derived(int i) : (i, 10) { ... }
New way
derived::derived(int i) : base(i, 10) { ... }
Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
|
What do you think about this topic? Send feedback!
|