Created on 2008-09-15.00:00:00 last changed 178 months ago
[Voted into WP at July, 2009 meeting.]
Proposed resolution (March, 2009):
Change 7.7 [expr.const] paragraph 3 as follows:
...as enumerator initializers (9.7.1 [dcl.enum]),as static member initializers (11.4.9.3 [class.static.data]),and as integral or enumeration non-type template arguments (13.6 [temp.type]).
Change 11.4.9.3 [class.static.data] paragraph 3 as follows:
If a static data member is of const effective literal type, its declaration in the class definition can specify a brace-or-equal-initializerwith anin which every initializer-clause that is an assignment-expression is aintegralconstant expression. A static data member of effective literal type can be declared in the class definition with the constexpr specifier; if so, its declaration shall specify a brace-or-equal-initializerwith anin which every initializer-clause that is an assignment-expression is aintegralconstant expression. [Note: In both these cases, the member may appear inintegralconstant expressions. —end note] The member shall still be defined in a namespace scope if it is used in the program and the namespace scope definition shall not contain an initializer.
[Drafting note: this change also corrects an editorial error resulting from overlapping changes that inadvertently retained the original restriction that only members of integral type could be initialized inside the class definition.]
The recent changes in the handling of initialization have not touched the requirement that the in-class initializer for a const static data member must be of the form = assignment-expression and not a braced-init-list. It would be more consistent and general to allow the braced form as well.
History | |||
---|---|---|---|
Date | User | Action | Args |
2010-03-29 00:00:00 | admin | set | status: wp -> cd2 |
2009-11-08 00:00:00 | admin | set | status: dr -> wp |
2009-08-03 00:00:00 | admin | set | messages: + msg2261 |
2009-08-03 00:00:00 | admin | set | status: ready -> dr |
2009-03-23 00:00:00 | admin | set | messages: + msg1891 |
2009-03-23 00:00:00 | admin | set | status: open -> ready |
2008-09-15 00:00:00 | admin | create |