天天看点

2.11 - [lex.key] - 【词法.关键字】

请不要转载本文;请不要以任何形式重新出版,发布本文;请在下载本文 24 小时内将其删除;禁止将本文用于商业目的。

2 Lexical conventions [lex]

2.11 Keywords [lex.key]

 

2 词法约定 【词法】

2.11 关键字 【词法.关键字】

 
The identifiers shown in Table 3 are reserved for use as keywords (that is, they are unconditionally treated as keywords in phase 7):

Table 3 - keywords

asm

do

if

return

typedef

auto

double

inline

short

typeid

bool

dynamic_cast

int

signed

typename

break

else

long

sizeof

union

case

enum

mutable

static

unsigned

catch

explicit

namespace

static_cast

using

char

export

new

struct

virtual

class

extern

operator

switch

void

const

false

private

template

volatile

const_cast

float

protected

this

wchar_t

continue

for

public

throw

while

default

friend

register

true

 

delete

goto

reinterpret_cast

try

 
 
表格 3 中出示的标识符被保留作为关键字(也就是说,它们在第 7 阶段中无条件地按关键字处理):

表格 3 - 关键字

asm

do

if

return

typedef

auto

double

inline

short

typeid

bool

dynamic_cast

int

signed

typename

break

else

long

sizeof

union

case

enum

mutable

static

unsigned

catch

explicit

namespace

static_cast

using

char

export

new

struct

virtual

class

extern

operator

switch

void

const

false

private

template

volatile

const_cast

float

protected

this

wchar_t

continue

for

public

throw

while

default

friend

register

true

 

delete

goto

reinterpret_cast

try

 
 
Furthermore, the alternative representations shown in Table 4 for certain operators and punctuators (2.5) are reserved and shall not be used otherwise:

Table 4 - alternative representations

and

and_eq

bitand

bitor

compl

not

not_eq

or

or_eq

xor

xor_eq

 
 
此外,表格 4 中列出的某些运算符和标点的候选表示符号(2.5)被保留,也不能使用。

表格 4 - 候选表示符号

and

and_eq

bitand

bitor

compl

not

not_eq

or

or_eq

xor

xor_eq

 
 
20) On systems in which linkers cannot accept extended characters, an encoding of the universal-character-name may be used in forming valid external identifiers. For example, some otherwise unused character or sequence of characters may be used to encode the

/u

in a universal-character-name. Extended characters may produce a long external identifier, but C++ does not place a translation limit on significant characters for external identifiers. In C++, upper- and lower-case letters are considered different for all identifiers.

 

20) 在那些连接器不能接受扩展字符的系统中,可能需要将统一字符名称编码以产生有效的外部标识符。例如,用某些其他的未用字符或字符序列为统一字符名称中的

/u

编码。扩展字符可能产生很长的外部标识符,但 C++ 不对外部标识符的字符数量设置翻译限制。在 C++ 中,标识符中的大写和小写字母被认为是不同的。

 

PREV [lex.name] | NEXT [lex.operators] 上一页 【词法.名字】 | 下一页 【词法.运算符】

继续阅读