These are the punctuation symbols in C++. The meaning of each symbol is detailed in the linked pages.
{ }
[ ]
operator[] in operator overloading. new[] operator in operator overloading (allocation function). delete[] operator in delete expression and operator overloading (deallocation function). #
##
( )
operator() in operator overloading. static_cast, const_cast, reinterpret_cast, or dynamic_cast, delimit the expression. typeid, sizeof, sizeof..., alignof, or noexcept (since C++11) expression, delimit the operand. if (including constexpr if) (since C++17), switch, while, do-while, or for(including range-based for) (since C++11) statement, delimit the controlling clause. defined, __has_include (since C++17), __has_cpp_attribute (since C++20) preprocessing operator. static_assert declaration, delimit the operands. (since C++11) decltype specifier, noexcept specifier, alignas specifier, conditional explicit specifier (since C++20), delimit the operand. (since C++11) decltype(auto) specifier. (since C++14) __VA_OPT__ replacement in a variadic macro definition. (since C++20) ;
:
module :private;). (since C++20) ...
?
::
.
.*
->
operator-> in operator overloading. ->*
operator->* in operator overloading. ~
operator~ in operator overloading. !
operator! in operator overloading. if statement. (since C++23) +
operator+ in operator overloading. operator+ in operator overloading. -
operator- in operator overloading. operator- in operator overloading. *
operator* in operator overloading. operator* in operator overloading. *this in a lambda capture list, to capture the current object by copy. (since C++17) /
operator/ in operator overloading. %
operator% in operator overloading. ^
operator^ in operator overloading. &
operator& in operator overloading. operator& in operator overloading. |
operator| in operator overloading. =
operator= in operator overloading, which might be a special member function (copy assignment operatoror move assignment operator (since C++11)). =default;) or deleted definition (=delete;) in function definition. (since C++11) +=
operator+= in operator overloading. -=
operator-= in operator overloading. *=
operator*= in operator overloading. /=
operator/= in operator overloading. %=
operator%= in operator overloading. ^=
operator^= in operator overloading. &=
operator&= in operator overloading. |=
operator|= in operator overloading. ==
operator== in operator overloading. !=
operator!= in operator overloading. <
operator< in operator overloading. static_cast, const_cast, reinterpret_cast, or dynamic_cast, introduce the type-id. template<> in template specialization declaration. #include directive __has_include preprocessing expression (since C++17) import declaration (since C++20) >
operator> in operator overloading. static_cast, const_cast, reinterpret_cast, or dynamic_cast, indicate the end of type-id. template<> in template specialization declaration. #include directive __has_include preprocessing expression (since C++17) import declaration (since C++20) <=
operator<= in operator overloading. >=
operator>= in operator overloading. <=> (since C++20)
operator<=> in operator overloading. &&
operator&& in operator overloading. ||
operator|| in operator overloading. <<
operator<< in operator overloading (bitwise operator or stream insertion operator). >>
operator>> in operator overloading (bitwise operator or stream extraction operator). > in a static_cast, const_cast, reinterpret_cast, or dynamic_cast, a template argument list, or a template parameter list. (since C++11) <<=
operator<<= in operator overloading. >>=
operator>>= in operator overloading. ++
operator++ in operator overloading. --
operator-- in operator overloading. ,
operator, in operator overloading. static_assert declaration, separate the arguments. (since C++11) | Alternative representations | alternative spellings for certain operators |
| C documentation for Punctuation | |
© cppreference.com
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
https://en.cppreference.com/w/cpp/language/punctuators