Initializer List
class Point {
private:
int x;
int y;
public:
Point(int i = 0, int j = 0):x(i), y(j) {}
};
enum Class
enum class Color { red, green, blue }; // enum class
enum Animal { dog, cat, bird, human }; // plain enum
enum class
es - enumerator names are local to the enum and their values do not implicitly convert to other types (like anotherenum
orint
)- Plain
enum
s - where enumerator names are in the same scope as the enum and their values implicitly convert to integers and other types