You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Otherwise, if T is an enumeration with a fixed underlying type ([dcl.enum]) U, the initializer-list has a single element v, v can be implicitly converted to U, and the initialization is direct-list-initialization, the object is initialized with the value T(v)
v cannot be implicitly converted to U at all, since the following rule
An expression E can be implicitly converted to a type T if and only if the declaration T t=E; is well-formed, for some invented temporary variable t
enum A:int{
a = 0
};
A a = 0; // ill-formed
There's no implicitly conversion that can convert 0 to type A. The relevant modification is suggested by CWG2374. However, its intent is:
v can be implicitly converted to the underlying type of T
So, Does it the current wording make no sense?
The text was updated successfully, but these errors were encountered:
xmh0511
changed the title
List initliazation of an enumeration with fixed type from a single element v
List initliazation of an enumeration with fixed underlying type from a single element v
Mar 26, 2021
v
cannot be implicitly converted to U at all, since the following ruleThere's no implicitly conversion that can convert 0 to type A. The relevant modification is suggested by CWG2374. However, its intent is:
So, Does it the current wording make no sense?
The text was updated successfully, but these errors were encountered: