附录B C++(www.cppentry.com)保留字
C++(www.cppentry.com)保留了一些单词供自己和C++(www.cppentry.com)库使用。程序员不应将保留字用作声明中的标识符。保留字分三类:关键字、替代标记(alternative token)和C++(www.cppentry.com)库保留名称。
B.1 C++(www.cppentry.com)关键字
关键字是组成编程(www.cppentry.com)语言词汇表的标识符,它们不能用于其他用途,如用作变量名。表B.1列出了C++(www.cppentry.com)关键字,其中以粗体显示的关键字也是ANSI C99标准中的关键字,而以斜体显示的关键字是C++(www.cppentry.com)11新增的。
表B.1 C++(www.cppentry.com)关键字
|
alignas< xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /> |
alignof |
asm |
auto |
bool |
|
break |
case |
catch |
char |
char16_t |
|
char32_t |
class |
const |
const_cast |
constexpr |
|
continue |
decltype |
default |
delete |
do |
|
double |
dynamic_cast |
else |
enum |
explicit |
|
export |
extern |
false |
float |
for |
|
friend |
goto |
if |
inline |
int |
|
long |
mutable |
namespace |
new |
noexcept |
|
nullptr |
operator |
private |
protected |
public |
|
register |
reinterpret_cast |
return |
short |
signed |
|
sizeof |
static |
static_assert |
static_cast |
struct |
|
switch |
template |
this |
thread_local |
throw |
|
true |
try |
typedef |
typeid |
typename |
|
union |
unsigned |
using |
virtual |
void |
|
volatile |
wchar_t |
while |
|
|