Unscoped (or Plain or C-Style) Enumerations Plain (or C-style) enums are entered in the same scope as the name of their enum, and implicitly convert to their integer value, e.g.
enum Color { red, green, blue }; int col = green; Color c2 = 1; // error: invalid conversion from 'int' to 'Color' [-fpermissive] enum CardColor { red, black }; // Error: "red" conflicts with a previous declaration...
A template is a class or a function that we can parameterize with a set of types or values.
Parameterized Types The vector-of-doubles can be generalized to a vector-of-anything type by making it a template:
// `template<typename T>` can be read as "for all types T". Older code // uses `template<class T>`, which is equivalent. template<typename T> class Vector { public: explicit Vector(int s); ~Vector() { delete[] elem; } // ....
quotes Doug McIlroy:
Those types are not “abstract”; they are as real as int and float.
What is the context of this quote?
A class is a user-defined type provided to represent a concept in the code of a program. Essentially, all language facilities beyond the fundamental types, operators, and statements exist to help define better class or to use them more conveniently....