All C++ Keywords
All C++ Keywords
A compact scan page listing C++ keywords and keyword-like alternative tokens in grouped form.
All C++ Keywords
A compact scan page listing C++ keywords and keyword-like alternative tokens in grouped form.
Use reference pages to confirm names, categories, nearby facilities, and the constraints that matter before writing or reviewing code.
This page is optimized for scanning. Use C++ language reference when you want more explanation.
class, struct, union, enumtypename, typedef, usingnamespace, template, concept, requirespublic, protected, privatefriend, virtual, override, final, explicit, inlinebool, char, char8_t, char16_t, char32_t, wchar_tshort, int, long, signed, unsignedfloat, double, voidconst, volatile, mutablestatic, extern, thread_local, registernew, deletetypeid, decltypesizeof, alignof, noexceptstatic_cast, dynamic_cast, const_cast, reinterpret_castand, and_eqbitand, bitorcomplnot, not_eqor, or_eqxor, xor_eqasm and some compiler-specific extensions may appear in toolchains, but they are not what you should reach for first in portable modern code.class Counter {
public:
constexpr explicit Counter(int start) : value_{start} {}
int next() {
if (value_ < 0) {
return 0;
}
return value_++;
}
private:
int value_{};
};
int main() {
Counter counter{1};
return counter.next();
}
This small example touches several common keywords in context: class, public, private, constexpr, explicit, if, return, and int. Keyword scan pages are most useful when you can connect the spelling list back to ordinary code quickly.
class Counter {
public:
constexpr explicit Counter(int start) : value_{start} {}
int next() {
if (value_ < 0) {
return 0;
}
return value_++;
}
private:
int value_{};
};
int main() {
Counter counter{1};
return counter.next();
}