You are on page 1of 2

C++ keywords

This is a lis t of res erved keywords in C++. Since they are us ed by the language, thes e keywords are not
available for re-denition or overloading.

alignas(sinc e C++11)
alignof(sinc e C++11)
and
and_eq
asm
auto(1)
bitand
bitor
bool
break
case
catch
char
char16_t(sinc e C++11)
char32_t(sinc e C++11)
class
compl
concept(c onc epts TS )
const
constexpr(sinc e C++11)
const_cast
continue
decltype(sinc e C++11)
default(1)
delete(1)
do
double
dynamic_cast

else
enum
explicit
export(1)
extern
false
float
for
friend
goto
if
inline
int
long
mutable
namespace
new
noexcept(sinc e C++11)
not
not_eq
nullptr(sinc e C++11)
operator
or
or_eq
private
protected
public
register
reinterpret_cast

requires(c onc epts TS )


return
short
signed
sizeof
static
static_assert(sinc e C++11)
static_cast
struct
switch
template
this
thread_local(sinc e C++11)
throw
true
try
typedef
typeid
typename
union
unsigned
using(1)
virtual
void
volatile
wchar_t
while
xor
xor_eq

(1) - meaning changed in C++11


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 repres ent s tandard tokens .
In addition to keywords , there are two identiers with special meaning, which may be us ed as names of
objects or functions , but have s pecial meaning in certain contexts .
override(C++11)
final(C++11)
Als o, all identiers that contain a double unders core __ in any pos ition and each identier that begins
with an unders core followed by an uppercas e letter is always res erved and all identiers that begin with
an unders core are res erved for us e as names in the global names pace. See identiers for more details .
The names pace stdis us ed to place names of the s tandard C++ library. See Extending names pace s td
for the rules about adding names to it.
The name posixis res erved for a future top-level names pace. The behavior is undened if
(sinc e C++11)
a program declares or denes anything in that names pace.
The following tokens are recognized by the preproces s or when in context of a preproces s or directive:
if
ifdef include
elif
ifndef line
else
define error
endif
undef pragma
defined
The following tokens are recognized by the preproces s or outside the context of a preproces s or directive:

_Pragma(sinc e C++11)

See also
C documentation for C keywords
Retrieved from "http://en.c ppreferenc e.c om/mwiki/index.php?title=c pp/keyword& oldid=79152"

You might also like