Created on 2011-05-12.00:00:00 last changed 148 months ago
Rationale (August, 2011):
The use of typedef names for linkage purposes is intended for C compatibility and should not be extended to features that are not part of the C subset of C++.
The text of 9.7.1 [dcl.enum] paragraph 2 explicitly forbids unnamed scoped enumerations:
The optional identifier shall not be omitted in the declaration of a scoped enumeration.
There does not appear to be a good rationale for this restriction since a typedef name can be used to name the enumerators. It is also inconsistent with similar constructs. For example,
typedef enum class { e } E; E x = E::e;
is ill-formed, but
typedef struct { enum { s }; } S; int y = S::s;
is well-formed.
History | |||
---|---|---|---|
Date | User | Action | Args |
2012-09-24 00:00:00 | admin | set | messages: + msg4024 |
2011-05-12 00:00:00 | admin | create |