Top "Enum-class" questions

Enum classes combine aspects of traditional enumerations (names values) with aspects of classes (scoped members and absence of conversions).

How can I output the value of an enum class in C++11

How can I output the value of an enum class in C++11? In C++03 it's like this: #include <iostream&…

c++ c++11 templates enums enum-class
Implementation of operators for enum class

Following the discussion in question Incrementation and decrementation of “enum class”, I'd like to ask about the possible implementation of …

c++ c++11 operator-overloading enum-class
Is it possible to determine the number of elements of a c++ enum class?

Is it possible to determine the cardinality of a c++ enum class: enum class Example { A, B, C, D, E }; …

c++ c++11 cardinality enum-class
Can't use enum class as unordered_map key

I have a class containing an enum class. class Shader { public: enum class Type { Vertex = GL_VERTEX_SHADER, Geometry = GL_…

c++ c++11 map enums enum-class
User Defined C++11 enum class Default Constructor

Is there a way to specify the default constructor of an enum class? I am using an enum class to …

c++ c++11 default-constructor enum-class
enum class of type string in C++

- Background Information: There is a class in C++11 known as enum class which you can store variables inside. However, …

c++ c++11 enum-class
C++11 standard conformant bitmasks using enum class

Can you implement standard conformant (as described in 17.5.2.1.3 of the n3242 draft) type safe bitmasks using enum class? The way …

c++ c++11 bit-fields bitmask enum-class
Enum Class "could not convert to unsigned int"

I have an enum class like this: typedef unsigned int binary_instructions_t; enum class BinaryInstructions : binary_instructions_t { END_…

c++ casting enum-class
Forward Declaring enum class not working

In State.h I have enum class StateID : unsigned int; In State.cpp I have enum class StateID : unsigned int { …

c++ c++11 forward-declaration enum-class
Is it possible to manually define a conversion for an enum class?

Normally you can define a cast for a class by using the following syntax: class Test { public: explicit operator bool() { …

c++ enums c++11 enum-class