---
title: "Keywords (C++)"
ms.custom: "index-page"
ms.date: "10/10/2018"
helpviewer_keywords: ["keywords [C++]"]
ms.assetid: d7ca94a8-f785-41ce-9f73-d3c4fd508489
---
# Keywords (C++)
Keywords are predefined reserved identifiers that have special meanings. They cannot be used as identifiers in your program. The following keywords are reserved for Microsoft C++. Names with leading underscores, and names followed by (C++/CLI) are Microsoft extensions.
|||||
|-|-|-|-|
|[__abstract](../dotnet/declaration-of-a-managed-class-type.md) 2|[__alignof](alignof-operator.md) 4|[__asm](../assembler/inline/asm.md) 4|[__assume](../intrinsics/assume.md) 4|
|[__based](based-pointers-cpp.md) 4|[__box](../dotnet/value-type-semantics.md) 2|[__cdecl](cdecl.md) 4|[__declspec](declspec.md) 4|
|[__delegate](../dotnet/delegates-and-events.md) 2|[__event](event.md)|[__except](try-except-statement.md) 4|[__fastcall](fastcall.md) 4|
|[__finally](try-finally-statement.md) 4|[__forceinline](inline-functions-cpp.md) 4|[__gc](../dotnet/declaration-of-a-clr-reference-class-object.md) 2|[__hook](hook.md) 3|
|[__identifier](../extensions/identifier-cpp-cli.md)|[__if_exists](if-exists-statement.md)|[__if_not_exists](if-not-exists-statement.md)|[__inline](inline-functions-cpp.md) 4|
|[__int16](int8-int16-int32-int64.md) 4|[__int32](int8-int16-int32-int64.md) 4|[__int64](int8-int16-int32-int64.md) 4|[__int8](int8-int16-int32-int64.md) 4|
|[__interface](interface.md)|[__leave](try-finally-statement.md) 4|[__m128](m128.md)|[__m128d](m128d.md)|
|[__m128i](m128i.md)|[__m64](m64.md)|[__multiple_inheritance](inheritance-keywords.md) 4|[__nogc](../dotnet/declaration-of-a-clr-reference-class-object.md) 2|
|[__noop](../intrinsics/noop.md)|**__pin** 2|**__property** 2|[__ptr32](ptr32-ptr64.md) 4|
|[__ptr64](ptr32-ptr64.md)4|[__raise](raise.md)|[__restrict](extension-restrict.md) 4|**__sealed** 2|
|[__single_inheritance](inheritance-keywords.md)4|[__sptr](sptr-uptr.md)4|[__stdcall](stdcall.md) 4|[__super](super.md)|
|[__thiscall](thiscall.md)|[__try_cast](../dotnet/cast-notation-and-introduction-of-safe-cast-angles.md) 2|[__unaligned](unaligned.md) 4|[__unhook](unhook.md) 3|
|[__uptr](sptr-uptr.md) 4|[__uuidof](uuidof-operator.md) 4|[__value](../dotnet/value-type-semantics.md) 2|[__vectorcall](vectorcall.md) 4|
|[__virtual_inheritance](inheritance-keywords.md) 4|[__w64](w64.md) 4|[__wchar_t](fundamental-types-cpp.md)|[abstract](../extensions/abstract-cpp-component-extensions.md)(C++/CLI)|
|[alignas](align-cpp.md)|[array](../extensions/arrays-cpp-component-extensions.md)(C++/CLI)|[auto](auto-keyword.md)|[bool](bool-cpp.md)|
|[break](break-statement-cpp.md)|[case](switch-statement-cpp.md)|[catch](try-throw-and-catch-statements-cpp.md)|[char](fundamental-types-cpp.md)|
|[char16_t](char-wchar-t-char16-t-char32-t.md)|[char32_t](char-wchar-t-char16-t-char32-t.md)|[class](class-cpp.md)|[const](const-cpp.md)|
|[const_cast](const-cast-operator.md)|[constexpr](constexpr-cpp.md)|[continue](continue-statement-cpp.md)|[decltype](decltype-cpp.md)|
|[default](switch-statement-cpp.md)|[delegate](../extensions/delegate-cpp-component-extensions.md)(C++/CLI)|[delete](delete-operator-cpp.md)|[deprecated](deprecated-cpp.md) 1|
|[dllexport](dllexport-dllimport.md) 1|[dllimport](dllexport-dllimport.md) 1|[do](do-while-statement-cpp.md)|[double](fundamental-types-cpp.md)|
|[dynamic_cast](dynamic-cast-operator.md)|[else](if-else-statement-cpp.md)|[enum](enumerations-cpp.md)|[enum class](../extensions/enum-class-cpp-component-extensions.md)|
|[enum struct](../extensions/enum-class-cpp-component-extensions.md)|[event](../extensions/event-cpp-component-extensions.md)(C++/CLI)|[explicit](user-defined-type-conversions-cpp.md)|[extern](using-extern-to-specify-linkage.md)|
|[false](false-cpp.md)|[finally](../dotnet/finally.md)|[float](fundamental-types-cpp.md)|[for](for-statement-cpp.md)|
|[for each in](../dotnet/for-each-in.md)|[friend](friend-cpp.md)|[friend_as](../preprocessor/hash-using-directive-cpp.md)|[gcnew](../extensions/ref-new-gcnew-cpp-component-extensions.md)(C++/CLI)|
|[generic](../extensions/generics-cpp-component-extensions.md)(C++/CLI)|[goto](goto-statement-cpp.md)|[if](if-else-statement-cpp.md)|[initonly](../dotnet/initonly-cpp-cli.md)|
|[inline](inline-functions-cpp.md)|[int](fundamental-types-cpp.md)|[interface class](../extensions/interface-class-cpp-component-extensions.md)(C++/CLI)|[interface struct](../extensions/interface-class-cpp-component-extensions.md)(C++/CLI)|
|[interior_ptr](../extensions/interior-ptr-cpp-cli.md)(C++/CLI)|[literal](../extensions/literal-cpp-component-extensions.md)(C++/CLI)|[long](fundamental-types-cpp.md)|[mutable](mutable-data-members-cpp.md)|
|[naked](naked-cpp.md) 1|[namespace](namespaces-cpp.md)|[new](../extensions/new-new-slot-in-vtable-cpp-component-extensions.md)(C++/CLI)|[new](new-operator-cpp.md)|
|[noexcept](noexcept-cpp.md)|[noinline](noinline.md) 1|[noreturn](noreturn.md) 1|[nothrow](nothrow-cpp.md) 1|
|[novtable](novtable.md) 1|[nullptr](nullptr.md)|[operator](operator-overloading.md)|[private](private-cpp.md)|
|[property](../extensions/property-cpp-component-extensions.md)(C++/CLI)|[property](property-cpp.md) 1|[protected](protected-cpp.md)|[public](public-cpp.md)|
|[ref class](../extensions/classes-and-structs-cpp-component-extensions.md)|[ref struct](../extensions/classes-and-structs-cpp-component-extensions.md)|[register](storage-classes-cpp.md#register)|[reinterpret_cast](reinterpret-cast-operator.md)|
|[return](return-statement-cpp.md)|[safecast](../extensions/safe-cast-cpp-component-extensions.md)|[sealed](../extensions/sealed-cpp-component-extensions.md)(C++/CLI)|[selectany](selectany.md) 1|
|[short](fundamental-types-cpp.md)|[signed](fundamental-types-cpp.md)|[sizeof](sizeof-operator.md)|[static](storage-classes-cpp.md)|
|[static_assert](static-assert.md)|[static_cast](static-cast-operator.md)|[struct](struct-cpp.md)|[switch](switch-statement-cpp.md)|
|[template](templates-cpp.md)|[this](this-pointer.md)|[thread](thread.md) 1|[throw](try-throw-and-catch-statements-cpp.md)|
|[true](true-cpp.md)|[try](try-throw-and-catch-statements-cpp.md)|[typedef](aliases-and-typedefs-cpp.md)|[typeid](typeid-operator.md)|
|[typeid](../extensions/typeid-cpp-component-extensions.md)|[typename](typename.md)|[union](unions.md)|[unsigned](fundamental-types-cpp.md)|
|[using](using-declaration.md) declaration|[using](namespaces-cpp.md#using_directives) directive|[uuid](uuid-cpp.md) 1|[value class](../extensions/classes-and-structs-cpp-component-extensions.md)(C++/CLI)|
|[value struct](../extensions/classes-and-structs-cpp-component-extensions.md)(C++/CLI)|[virtual](virtual-cpp.md)|[void](void-cpp.md)|[volatile](volatile-cpp.md)|
|[while](while-statement-cpp.md)|
1 Extended attributes for the **__declspec** keyword.
2 Applicable to Managed Extensions for C++ only. This syntax is now deprecated. See [Component Extensions for Runtime Platforms](../extensions/component-extensions-for-runtime-platforms.md) for more information.
3 Intrinsic function used in event handling.
4 For backward compatibility with previous versions, these keywords are available both with two leading underscores and a single leading underscore when Microsoft extensions are enabled (the default).
**Microsoft Specific**
In Microsoft C++, identifiers with two leading underscores are reserved for compiler implementations. Therefore, the Microsoft convention is to precede Microsoft-specific keywords with double underscores. These words cannot be used as identifier names.
Microsoft extensions are enabled by default. To ensure that your programs are fully portable, you can disable Microsoft extensions by specifying the [/Za \(Disable language extensions)](../build/reference/za-ze-disable-language-extensions.md) option during compilation. When you do this, some Microsoft-specific keywords are disabled.
When Microsoft extensions are enabled, you can use the Microsoft-specific keywords in your programs. For ANSI compliance, these keywords are prefaced by a double underscore. For backward compatibility, single-underscore versions of many of the double-underscored keywords are supported. In addition, **__cdecl** is available with no leading underscore.
The **__asm** keyword replaces C++ `asm` syntax. `asm` is reserved for compatibility with other C++ implementations, but not implemented. Use **__asm**.
The **__based** keyword has limited uses for 32-bit and 64-bit target compilations.
**END Microsoft Specific**
## See also
[Lexical Conventions](../cpp/lexical-conventions.md)
[C++ Built-in Operators, Precedence and Associativity](../cpp/cpp-built-in-operators-precedence-and-associativity.md)