Difference between revisions of "cpp/keyword"
D41D8CD98F (Talk | contribs) (IMO 'operator' gained new meaning in C++11, and not in C++23. ('static operator' is still an overloaded operator function)) |
m |
||
Line 14: | Line 14: | ||
{{rlt|and_eq}}<br> | {{rlt|and_eq}}<br> | ||
{{rlt|asm}}<br> | {{rlt|asm}}<br> | ||
− | {{ | + | {{rlt|atomic_cancel}} {{mark since tm ts}}<br> |
− | {{ | + | {{rlt|atomic_commit}} {{mark since tm ts}}<br> |
− | {{ | + | {{rlt|atomic_noexcept}} {{mark since tm ts}}<br> |
{{rlt|auto}} {{mark|1}} {{mark|2}} {{mark|3}} {{mark|4}}<br> | {{rlt|auto}} {{mark|1}} {{mark|2}} {{mark|3}} {{mark|4}}<br> | ||
{{rlt|bitand}}<br> | {{rlt|bitand}}<br> | ||
Line 88: | Line 88: | ||
{{rlt|struct}} {{mark|1}}<br> | {{rlt|struct}} {{mark|1}}<br> | ||
{{rlt|switch}}<br> | {{rlt|switch}}<br> | ||
− | {{ | + | {{rlt|synchronized}} {{mark since tm ts}}<br> |
{{rlt|template}}<br> | {{rlt|template}}<br> | ||
{{rlt|this}} {{mark|4}}<br> | {{rlt|this}} {{mark|4}}<br> | ||
Line 123: | Line 123: | ||
{{ltt|cpp/language/final}} {{mark c++11}}<br> | {{ltt|cpp/language/final}} {{mark c++11}}<br> | ||
{{ltt|cpp/language/override}} {{mark c++11}}<br> | {{ltt|cpp/language/override}} {{mark c++11}}<br> | ||
− | {{ | + | {{rlt|transaction_safe}} {{mark since tm ts}}<br> |
− | {{ | + | {{rlt|transaction_safe_dynamic}} {{mark since tm ts}}<br> |
{{rlt|import}} {{mark c++20}}<br> | {{rlt|import}} {{mark c++20}}<br> | ||
{{rlt|module}} {{mark c++20}} | {{rlt|module}} {{mark c++20}} |
Revision as of 07:22, 11 August 2024
This is a list of reserved keywords in C++. Since they are used by the language, these keywords are not available for re-definition or overloading. As an exception, they are not considered reserved in attributes (excluding attribute argument lists).(since C++11)
- (1) — meaning changed or new meaning added in C++11.
- (2) — meaning changed or new meaning added in C++17.
- (3) — meaning changed or new meaning added in C++20.
- (4) — new meaning added in C++23.
Note that and
, bitor
, or
, xor
, compl
, bitand
, and_eq
, or_eq
, xor_eq
, not
, and not_eq
(along with the digraphs <%, %>, <:, :>, %:, and %:%:) provide an alternative way to represent standard tokens. These keywords are also considered reserved in attributes (excluding attribute argument lists), but some implementations handle them the same as the others.(since C++11)
In addition to keywords, there are identifiers with special meaning, which may be used as names of objects or functions, but have special meaning in certain contexts.
final (C++11) |
Also, all identifiers that contain a double underscore __
in any position and each identifier that begins with an underscore followed by an uppercase letter is always reserved and all identifiers that begin with an underscore are reserved for use as names in the global namespace. See identifiers for more details.
The namespace std
is used to place names of the standard C++ library. See Extending namespace std for the rules about adding names to it.
The name |
(since C++11) |
The following tokens are recognized by the preprocessor when in context of a preprocessor directive:
defined |
The following tokens are recognized by the preprocessor outside the context of a preprocessor directive:
_Pragma (C++11) |
See also
C documentation for C keywords
|