Is there any way to initialize enum value like this:
enum Test
{
X = function("X")
};
Currently in Visual Studio I get this error:
error C2057: expected constant expression
And Visual Studio doesn't support constexpr
The enumerator list within an enum declaration is defined as follows:
enumerator-list - comma-separated list of enumerator definitions, each of which is either simply an identifier, which becomes the name of the enumerator, or an identifier with an initializer: identifier = constexpr
You may only use constant expressions.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With