This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 112e. See for the official list.


902. In-class initialization of non-constant static data members

Section:  []     Status: NAD     Submitter: Daniel Krügler     Date: 21 May, 2009

The current wording of [] only allows a static data member to be initialized within the class definition if it is const. This restriction should be removed.

Rationale (July, 2009):

The consensus of the CWG was that there is insufficient motivation for such a change. A non-const static data member must still be defined outside the class if it is used, and the value of such a member cannot be used in a constant expression, unlike a constant static data member, so there is no real advantage to putting the initializer inside the class definition instead of in the definition of the static data member. The apparent parallel with non-static data member initialization is also not compelling; for example, the initializer for a non-static data member can contain forward references to members declared later in the class, while the same is not true of static data member initializers.