Created on 2011-03-29.00:00:00 last changed 149 months ago
Additional note (August, 2012):
It was observed that, since no definition of a const static data member is required if it is not odr-used, there is no reason to prohibit such members in an unnamed class even without a typedef name for linkage purposes.
According to 11.4.9.3 [class.static.data] paragraph 4,
Unnamed classes and classes contained directly or indirectly within unnamed classes shall not contain static data members.
There is no such restriction on member functions, and there is no rationale for this difference, given that both static data members and member functions can be defined outside a unnamed class with a typedef name for linkage purposes. (Issue 406 acknowledged the lack of rationale by removing the specious note in 11.4.9.3 [class.static.data] that attempted to explain the restriction but left the normative prohibition in place.)
It would be more consistent to remove the restriction for classes with a typedef name for linkage purposes.
History | |||
---|---|---|---|
Date | User | Action | Args |
2012-09-24 00:00:00 | admin | set | messages: + msg3897 |
2011-03-29 00:00:00 | admin | create |