Alternative operator representations
提供:cppreference.com
|
|
This page has been machine-translated from the English version of the wiki using Google Translate.
The translation may contain errors and awkward wording. Hover over text to see the original version. You can help to fix errors and improve the translation. For instructions click here. |
との互換性。 C + +(とC)のソースコードはISO 646/ECMA-6不変文字セットを含む任意の非ASCII 7ビット文字セットで書かれているかもしれません。しかし、いくつかのC + +演算子と切子のISO 646コードセットの外にある文字を必要とする:
{, }, [, ], #, \, ^, |, ~。追加キーワードは、これらの文字と解釈されている2つまたは3つのISO 646互換性のある特殊な文字の組み合わせを使用する演算子に対応していますこれらの記号の一部またはすべてが存在していない文字エンコードを使用できるようにするには、C + +の代替案の2種類を定義彼らは、単一の非ISO 646文字だったかのよう.Original:
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.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
目次 |
[編集] 代替キーワード
C + +標準のキーワードとして定義されたいくつかの演算子の代替スペルがあります.
Original:
There are alternative spellings for several operators defined as keywords in the C++ standard.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
| 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>言語のキーワードですが、何かを定義していませんので.
Original:
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.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
[編集] ダイグラフやトリグラフ
2と3文字(ダイグラフやトリグラフ)の次の組合せは、それぞれの主要な文字の有効な置換である:
Original:
The following combinations of two and three characters (digraphs and trigraphs) are valid substitutions for their respective primary characters:
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
| Primary | Digraph | Trigraph |
|---|---|---|
{ |
<% |
??<
|
None} |
%> |
??>
|
[ |
<: |
??(
|
] |
:> |
??)
|
# |
%: |
??=
|
\ |
??/
| |
^ |
??'
| |
| |
??!
| |
~ |
??-
|
[編集] キーワード
and, and_eq, bitand, bitor, compl, not, not_eq, or, or_eq, xor, xor_eq
[編集] 例
次の例では、いくつかの代替キーワードの使用方法を示しています
Original:
The following example demonstrates the use of several alternative keywords:
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
%:include <iostream> int main(int argc, char *argv<::>) <% if (argc > 1 and argv<:1:> not_eq '\0') <% std::cout << "Hello " << argv<:1:> << '\n'; %> %>