User Tools

Site Tools


c_enums

This is an old revision of the document!


Overview

C++11 extensions to enums – enum classes versus original “plain” enums.

Basics

enum class Color { red, green, blue };
...
Color::red
Color::green

Possible definitions:

Warning w1 = Warning::red;
enum Warning w2 = Warning::green;
enum class Warning w3 = Warning::blue; // no
c_enums.1517739288.txt.gz · Last modified: 2018/02/04 10:14 by rpjday