Enum class: does not name the value error

I have

enum class ErrorLevel
    {
        VERBOSE,
        DEBUG_,
        INFORMATION,
        WARNING,
        ERROR
    };

      

It works:

assertDetectionParameters( parameterSet, ErrorLevel::WARNING );

      

It does not mean:

assertDetectionParameters( parameterSet, ErrorLevel::ERROR );

      

Error 1 error C2589: 'constant': illegal token on the right side '::'
Error 2 errors C2059: syntax error: '::'

Resharper says:

"ErrorLevel does not specify a value"

I am getting this error for certain names in my enum.

+3


source to share


1 answer


ERROR

there is probably already a preprocessor macro. Try changing it to something else, for example. ERROR_

to test this hypothesis. Alternatively, run your code through the preprocessor to see what substitutions are being performed ( gcc -E ...

or something similar in Visual Studio).



+1


source







All Articles