Punctuation - cppreference.com (original) (raw)

These are the punctuation symbols in C++. The meaning of each symbol is detailed in the linked pages.

Contents

[edit] Preprocessing operators

Preprocessing operators are recognized by preprocessors.

[edit] # (including %:)

[edit] ##(including %:%:)

[edit] Single-character operators and punctuators

[edit] { and } (including <% and %>)

In a requires expression, delimit the requirements. In a compound requirement, delimit the expression. In an export declaration, delimit the declarations. (since C++20)

[edit] [ and ] (including <: and :>)

[edit] ( and )

[edit] ;

a module declaration, import declaration, global module fragment introducer, or private module fragment introducer a requirement (since C++20)

[edit] :

In a range-based for statement, separate the item-declaration and the range-initializer. In the enum-base of an enumeration declaration, introduce the underlying type. (since C++11)
In an attribute specifier, separate the attribute-namespace and the attribute-list. (since C++17)
In a module declaration or import declaration of module partition, introduce the module partition name. Part of a private module fragment introducer (module :private;). (since C++20)

[edit] ?

[edit] .

[edit] ~ (including compl)

[edit] ! (including not)

[edit] +

[edit] -

[edit] *

Part of *this in a lambda capture list, to capture the current object by copy. (since C++17)

[edit] /

[edit] %

[edit] ^ (including xor)

[edit] & (including bitand)

[edit] | (including bitor)

[edit] =

Capture default in lambda capture, to indicate by-copy capture. Part of defaulted definition (=default;) or deleted definition (=delete;) in function definition. In a type alias declaration, separate the alias and the aliased type. (since C++11)
In a concept definition, separate the concept name and the constraint expression. (since C++20)

[edit] <

[edit] >

[edit] ,

In a static_assert declaration, separate the arguments. (since C++11)

[edit] Multi-character operators and punctuators

[edit] ...

[edit] ::

[edit] .*

[edit] ->

[edit] ->*

[edit] +=

[edit] -=

[edit] *=

[edit] /=

[edit] %=

[edit] ^= (including xor_eq)

[edit] &= (including and_eq)

[edit] |= (including or_eq)

[edit] ==

[edit] != (including not_eq)

[edit] <=

[edit] >=

[edit] && (including and)

[edit] || (including or)

[edit] <<

[edit] >>

[edit] <<=

[edit] >>=

[edit] ++

[edit] --

[edit] References

[edit] See also