Type specifiers
Type specifiers indicate the type of the object being
declared. See the following available kinds of
types:
- Fundamental or built-in types:
- Arithmetic types
- Integral types
- Boolean types
- Floating-point types
- Fixed-point decimal types
- Character types
- The void type
- Arithmetic types
- User-defined types
A type is a literal type
if it satisfies one of the following conditions:
- It is a scalar type.
- It is a reference type.
- It is an array of literal type.
- It is a class type with all the following properties:
- The class has a trivial destructor.
- Each constructor call and full expression in the initializers for nonstatic data members (if any) is a constant expression.
- The class is an aggregate type or has at least one
constexpr
constructor or constructor template that is not a copy or move constructor. - All nonstatic data members and base classes of the class are of literal types.
In the C++11 standard,
the following type specifiers are introduced:
- The auto type specifier
- The decltype(expression) type specifier