cppannotations/annotations/yo/first/keywords.yo
Frank B. Brokken adac2cda2e fixed typos
2017-06-08 11:08:25 +02:00

50 lines
2.7 KiB
Text

bf(C++)'s i(keywords) are a superset of bf(C)'s keywords. Here is a
list of all keywords of the language:
COMMENT(table generated by src/keywordsort.cc)
verb(
alignas char32_t enum namespace return typedef
alignof class explicit new short typeid
and compl export noexcept signed typename
and_eq concept extern not sizeof union
asm const false not_eq static unsigned
auto const_cast float nullptr static_assert using
axiom constexpr for operator static_cast virtual
bitand continue friend or struct void
bitor decltype goto or_eq switch volatile
bool default if private template wchar_t
break delete import protected this while
case do inline public thread_local xor
catch double int register throw xor_eq
char dynamic_cast long reinterpret_cast true
char16_t else mutable requires try
)
Notes:
itemization(
it() The ti(export) keyword is no longer actively used by bf(C++), but it
is kept as a keyword, reserved for future use.
it() Since the i(C++17) standard the keyword ti(register) is no longer
used, but it remains a reserved identifier. In other words, definitions
like verb(
register int index;
)
result in compilation errors. Also, tt(register) is no longer
considered a i(storage class specifier) (storage class specifiers are
tt(extern, thread_local, mutable) and tt(static)).
it() the hi(operator: keywords)em(operator keywords): tt(and, and_eq,
bitand, bitor, compl, not, not_eq, or, or_eq, xor) and tt(xor_eq) are symbolic
alternatives for, respectively, tt(&&, &=, &, |, ~, !, !=, ||, |=, ^) and
tt(^=).
it() bf(C++) also recognizes the special identifiers tt(final) and
tt(override). These identifiers are special in the sense that they acquire
special meanings when declaring classes or polymorphic functions. Section
ref(FINAL) provides further details.
)
Keywords can only be used for their intended purpose and cannot be used as
names for other entities (e.g., variables, functions, class-names, etc.). In
addition to keywords i(identifiers starting with an underscore) and living in
the emi(global namespace) (i.e., not using any explicit namespace or using the
mere tt(::) namespace specification) or living in the em(std namespace) are
i(reserved identifiers) in the sense that their use is a prerogative of the
implementor.