首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

keywords

这是C++中保留的关键字列表。由于语言使用这些关键字,因此不能用于重新定义或重载。

alignas (since C++11) alignof (since C++11) and and_eq asm atomic_cancel (TM TS) atomic_commit (TM TS) atomic_noexcept (TM TS) auto(1) bitand bitor bool break case catch char char16_t (since C++11) char32_t (since C++11) class(1) compl concept (concepts TS) const constexpr (since C++11) const_cast continue decltype (since C++11) default(1) delete(1) do double.

dynamic_cast else enum explicit export(1) extern(1) false float for friend goto if import (modules TS) inline(1) int long module (modules TS) mutable(1) namespace new noexcept (since C++11) not not_eq nullptr (since C++11) operator or or_eq private protected public register(2).

reinterpret_cast requires (concepts TS) return short signed sizeof(1) static static_assert (since C++11) static_cast struct(1) switch synchronized (TM TS) template this thread_local (since C++11) throw true try typedef typeid typename union unsigned using(1) virtual void volatile wchar_t while xor xor_eq.

  • %281%29-在C++11中更改了含义或添加了新的含义。注意:关键字export也被模块TS使用。
  • %282%29-C++17中的意思改变了。

请注意and,,,bitor,,,or,,,xor,,,compl,,,bitand,,,and_eq,,,or_eq,,,xor_eq,,,not,和not_eq%28连同有向图<%,,,%>,,,<:,,,:>,,,%:,和%:%:%29提供表示标准令牌的替代方法...

除了关键字,还有具有特殊意义的标识符,它可以用作对象或函数的名称,但在某些上下文中具有特殊的意义。

覆盖%28C++11%29最终%28C++11%29事务[医]安全%28 TM TS%29事务[医]安全[医]动力%28 TM TS%29。

*。

还有,所有标识符包含双下划线的[医][医]在以下划线开头的任何位置和每个标识符中,总是保留大写字母,并保留以下划线开头的所有标识符,以便作为全局命名空间中的名称使用。见标识符更多细节。

命名空间std用于放置标准C++库的名称。见扩展命名空间STD为它添加名字的规则。

The name posix is reserved for a future top-level namespace. The behavior is undefined if a program declares or defines anything in that namespace.

(since C++11)

下面的令牌由预处理器在预处理指令的上下文中:

if elif else endif defined.

ifdef ifndef define undef.

include line error pragma.

预处理程序可以识别以下令牌预处理指令的上下文:

[医]普拉格玛%28自C++11%29。

*。

另见

C关键字的C文档

*。

代码语言:txt
复制
 ? cppreference.com

在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。

扫码关注腾讯云开发者

领取腾讯云代金券

http://www.vxiaotou.com