Namespaces
Variants
Actions

Type

From cppreference.com
< cpp‎ | language
 
 
C++ language
General topics
Flow control
Conditional execution statements
if
Iteration statements (loops)
for
range-for (C++11)
Jump statements
Functions
Function declaration
Lambda function expression
inline specifier
Dynamic exception specifications (until C++17*)
noexcept specifier (C++11)
Exceptions
Namespaces
Types
Specifiers
const/volatile
decltype (C++11)
auto (C++11)
constexpr (C++11)
consteval (C++20)
constinit (C++20)
Storage duration specifiers
Initialization
Expressions
Alternative representations
Literals
Boolean - Integer - Floating-point
Character - String - nullptr (C++11)
User-defined (C++11)
Utilities
Attributes (C++11)
Types
typedef declaration
Type alias declaration (C++11)
Casts
Memory allocation
Classes
Class-specific function properties
explicit (C++11)
static

Special member functions
Templates
Miscellaneous
 
 

Objects, references, functions including function template specializations, and expressions have a property called type, which both restricts the operations that are permitted for those entities and provides semantic meaning to the otherwise generic sequences of bits.

Contents

[edit] Type classification

The C++ type system consists of the following types:

(since C++11)
  • the type bool;
  • character types:
  • narrow character types:
  • ordinary character types: char, signed char, unsigned char[1]
  • the type char8_t
(since C++20)
  • wide character types: char16_t, char32_t, (since C++11)wchar_t;
  • signed integer types:
  • standard signed integer types: signed char, short, int, long, long long;
  • extended signed integer types (implementation-defined);
(since C++11)
  • unsigned integer types:
  • standard unsigned integer types: unsigned char, unsigned short, unsigned, unsigned long, unsigned long long;
  • extended unsigned integer types (each corresponds to an extended signed integer type, and vice versa);
(since C++11)
(since C++23)
  • lvalue reference to object types;
  • lvalue reference to function types;
  • rvalue reference to object types;
  • rvalue reference to function types;
(since C++11)