Created on 2018-02-21.00:00:00 last changed 47 months ago
Rationale (November, 2018):
Current implementations support this usage and it does not appear to cause any problems.
According to 11.4.9.3 [class.static.data] paragraph 3,
An inline static data member may be defined in the class definition and may specify a brace-or-equal-initializer. If the member is declared with the constexpr specifier, it may be redeclared in namespace scope with no initializer (this usage is deprecated; see _N4778_.D.4 [depr.static_constexpr]).
The out-of-class declaration of a static data member was formerly a definition and thus limited to occurring only once. This limitation was lost when the in-class declaration of inline static data members became the definition; the current specification has no apparent prohibition against multiple out-of-class declarations of a constexpr static data member. Should the restriction be reinstated?
History | |||
---|---|---|---|
Date | User | Action | Args |
2020-12-15 00:00:00 | admin | set | messages: + msg6307 |
2018-02-21 00:00:00 | admin | create |