Reputation: 22133
There are two conflicting definitions of enum class
in Visual C++ 2012:
enum
System::Enum
derived type, equivalent to a ref class
with static const integral members.Does the meaning of enum class
change when you enable or disable the /clr switch?
Upvotes: 3
Views: 1532
Reputation: 355049
A managed enumeration must have an access specifier (either public
or private
). A C++11 scoped enumeration must not have an access specifier. For example,
enum class E { e0 };
public enum class F { f0 };
private enum class G { g0 };
E
is valid in C++, C++/CLI, and C++/CX, and it is an ordinary C++ scoped enumeration.
F
and G
are valid only in C++/CLI and C++/CX, and they name a managed enumeration (in C++/CLI) or a Windows Runtime enumeration (in C++/CX).
Upvotes: 7