W3cubDocs

/C++

C++ language

This is a reference of the core C++ language constructs.

Basic concepts.

Comments
ASCII chart
Punctuation
Names and identifiers
TypesFundamental types
ObjectScopeLifetime
Definitions and ODR
Name lookup
qualifiedunqualified (ADL)
As-if rule
Undefined behavior (UB)
Memory model and data races
Character sets and encodings
Phases of translation
The main function
Modules (C++20)
.

Keywords.

Preprocessor.

#if - #ifdef - #ifndef - #elif
#elifdef - #elifndef (C++23)
#define - # - ##
#include - #pragma
#line - #error - #warning (C++23)
.

Expressions.

Value categories
Evaluation order and sequencing
Constant expressions
Operators
assignmentarithmetic
increment and decrement
logicalcomparison
member access and indirection
call, comma, ternary
sizeofalignof (C++11)
newdeletetypeid
alternative representation
Operator overloading
Default comparisons (C++20)
Operator precedence
Conversions
implicitexplicituser-defined
Usual arithmetic conversions
static_castdynamic_cast
const_castreinterpret_cast
Literals (Escape sequences)
booleanintegerfloating
characterstring
nullptr (C++11)
user-defined (UDL) (C++11)
.

Declarations.

Namespace declaration
Namespace alias
ReferencesPointersArrays
Structured bindings (C++17)
Enumerations and enumerators
Storage duration and linkage
Translation-unit-local (C++20)
Language linkage
inline specifier
Inline assembly
const/volatile
constexpr (C++11)
consteval (C++20)
constinit (C++20)
decltype (C++11)auto (C++11)
typedefType alias (C++11)
Elaborated type specifiers
Attributes (C++11)
alignas (C++11)
static_assert (C++11)
.

Initialization.

Default initialization
Value initialization
Copy initialization
Direct initialization
Aggregate initialization
List initialization (C++11)
Reference initialization
Static non-local initialization
zeroconstant
Dynamic non-local initialization
orderedunordered
Copy elision (RVO).

Functions.

Function declaration
Default arguments
Variadic arguments
Lambda expression (C++11)
Argument-dependent lookup
Overload resolution
Operator overloading
Address of an overload set
Coroutines (C++20)
.

Statements.

ifswitch
forrange-for (C++11)
whiledo-while
continuebreakgotoreturn
synchronized and atomic (TM TS)
.

Classes.

Class typesUnion types
injected-class-name
Data membersBit-fields
Member functionsThe this pointer
Static membersNested classes
Derived classusing-declaration
Empty base optimization (EBO)
Virtual functionAbstract class (ABC)
override (C++11)final (C++11)
Member accessfriend
Constructors and member initializer lists
Default constructorDestructor
Copy constructorCopy assignment
Move constructor (C++11)
Move assignment (C++11)
Converting constructor
explicit specifier
.

Templates.

Template parameters and arguments
Class templateFunction template
Variable template (C++14)
Class member template
Template argument deduction
Class template argument deduction (CTAD) (C++17)
Explicit specializationPartial specialization
Parameter packs (C++11)sizeof... (C++11)
Fold-expressions (C++17)
Dependent namesSFINAE
Constraints and concepts (C++20)
Requires expression (C++20)
.

Exceptions.

throw-expression
try-catch block
Function-try-block
noexcept specifier (C++11)
noexcept operator (C++11)
Dynamic exception specification (until C++17*)
.

Miscellaneous.

History of C++
Extending the namespace std
Acronyms: CPO, IFNDR, NDR, NTBS,
NTTP, RAO, SOCCC, TMP, TU.

Idioms.

Curiously Recurring Template Pattern (CRTP)
Pointer to implementation (PIMPL)
Resource acquisition is initialization (RAII)
Rule of three/five/zero
Zero-overhead principle
.

See also

C documentation for C language constructs

© cppreference.com
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
https://en.cppreference.com/w/cpp/language