Alternative operator representations

来自cppreference.com
< cpp‎ | language

 
 
C++语言

|- class="t-nv-h1" | colspan="5" | 一般主题 |- | |- |

预处理器
注释

|

|-

|- class="t-nv-h1" | colspan="5" | 流程控制 |-

条件执行语句

| |- |

|

|-

循环语句

| |- |

|

|-

跳转语句

| |- |

|

|-

|- class="t-nv-h1" | colspan="5" | 函数 |-

函数声明 Lambda函数声明 inline说明符 异常说明符 (已弃用) noexcept说明符 (C++11)

|- class="t-nv-h1" | colspan="5" | Exceptions |- | |- |

|

|-

|- class="t-nv-h1" | colspan="5" | 命名空间 |- | |- |

|

|-

|- class="t-nv-h1" | colspan="5" | 类型 |- | |- |

|

|-

说明符

| |- |

decltype (C++11)
auto (C++11)
alignas (C++11)

|

|-

存储持续期说明符 Initialization

| |- |

|

|-

|- class="t-nv-h1" | colspan="5" | 表达式 |- | |- |

值类别
求值顺序

|

|-

替代表示 字面量 布尔型 - 整型 - 浮点型 字符型 - 字符串 - nullptr (C++11) 用户定义 (C++11)

|- class="t-nv-h1" | colspan="5" | Utilities |-

属性 (C++11) Types typedef声明 类型别名声明 (C++11) Casts 隐式类型转换 - 显示类型转换 static_cast - dynamic_cast const_cast - reinterpret_cast 内存分配

| |- |

|

|-

|- class="t-nv-h1" | colspan="5" | 类 |- | |- |

|

|-

类特有的函数属性

| |- |

|

explicit (C++11)
static

|-

静态成员函数

| |- |

|

|- |- class="t-nv-h1" | colspan="5" | 模板 |- | |- |

|

|- |- class="t-nv-h1" | colspan="5" | 杂项 |- | |- |

|

|-

 
C + +(C),源代码可以写在任何非ASCII 7位字符集,其中包括ISO 646/ECMA-6不变的字符集。然而,一些C + +运算符和标点符号需要ISO 646的代码集之外的字符:{, }, [, ], #, \, ^, |, ~。要能够使用字符编码的其中一些或所有的这些符号做不存在,Ç+ +定义两个种的替代品:额外的关键字对应的运营商使用这些字符和特殊组合的两个或三个的ISO 646兼容的字符进行解释的如果他们是一个单一的非ISO 646的性格
原文:
C++ (and C) source code may be written in any non-ASCII 7-bit character set that includes the ISO 646/ECMA-6 invariant character set. However, several C++ operators and punctuators require characters that are outside of the ISO 646 codeset: {, }, [, ], #, \, ^, |, ~. To be able to use character encodings where some or all of these symbols do not exist, C++ defines two kinds of alternatives: additional keywords that correspond to the operators that use these characters and special combinations of two or three ISO 646 compatible characters that are interpreted as if they were a single non-ISO 646 character.
这段文字是通过 Google Translate 自动翻译生成的。
您可以帮助我们检查、纠正翻译中的错误。详情请点击这里

目录

[编辑] 替代关键字

有其他几家运营商的关键字在C + +标准定义为拼写.
原文:
There are alternative spellings for several operators defined as keywords in the C++ standard.
这段文字是通过 Google Translate 自动翻译生成的。
您可以帮助我们检查、纠正翻译中的错误。详情请点击这里
Primary Alternative
&& and
&= and_eq
& bitand
| bitor
~ compl
! not
!= not_eq
|| or
|= or_eq
^ xor
^= xor_eq

[编辑] 的兼容性C

同样的话被定义在包含文件中<iso646.h>为宏在C编程语言。由于在C + +这些语言的关键字,C + +版本的<iso646.h>,以及<ciso646>,不定义任何东西.
原文:
The same words are defined in the C programming language in the include file <iso646.h> as macros. Because in C++ these are language keywords, the C++ version of <iso646.h>, as well as <ciso646>, does not define anything.
这段文字是通过 Google Translate 自动翻译生成的。
您可以帮助我们检查、纠正翻译中的错误。详情请点击这里

[编辑] 有向图和三字母

以下两个和三个字符的组合(有向图和三字母)替换为各自的主要特征是有效的
原文:
The following combinations of two and three characters (digraphs and trigraphs) are valid substitutions for their respective primary characters:
这段文字是通过 Google Translate 自动翻译生成的。
您可以帮助我们检查、纠正翻译中的错误。详情请点击这里
Primary Digraph Trigraph
{ <% ??<
None} %> ??>
[ <: ??(
] :> ??)
# %: ??=
\ ??/
^ ??'
| ??!
~ ??-

[编辑] 关键字

and, and_eq, bitand, bitor, compl, not, not_eq, or, or_eq, xor, xor_eq

[编辑] 示例

下面的例子演示了如何使用几种可供选择的关键词
原文:
The following example demonstrates the use of several alternative keywords:
这段文字是通过 Google Translate 自动翻译生成的。
您可以帮助我们检查、纠正翻译中的错误。详情请点击这里

%:include <iostream>
 
int main(int argc, char *argv<::>) 
<%
    if (argc > 1 and argv<:1:> not_eq '\0') <%
        std::cout << "Hello " << argv<:1:> << '\n';
    %>
%>


来自“http://zh.cppreference.com/mwiki/index.php?title=cpp/language/operator_alternative&oldid=38174