?
Ce document utilise Manuel du site Web PHP chinois Libérer
如最初公布的那樣,C11 不允許結(jié)構(gòu)和工會(huì)成員使用 alignas 規(guī)范; 這由 DR 444糾正了。
在 C ++中,說明alignas
符也可以應(yīng)用于類/結(jié)構(gòu)體/聯(lián)合體類型和枚舉的聲明。這在 C 中不受支持,但可以通過在成員聲明中使用 alignas 來控制結(jié)構(gòu)類型的對(duì)齊方式(自 DR 444起)。
_Alignas
.
| Primary | Alternative |
| && | and (macro constant) |
| &= | and_eq (macro constant) |
| & | bitand (macro constant) |
| | | bitor (macro constant) |
| ~ | compl (macro constant) |
| ! | not (macro constant) |
| != | not_eq (macro constant) |
C11標(biāo)準(zhǔn)(ISO / IEC 9899:2011):
6.7.5對(duì)齊說明符
6.2.8對(duì)象對(duì)齊(p:48-49)
7.15對(duì)齊<stdalign.h>(p:268)
| ^ | xor (macro constant) |
| ^= | xor_eq (macro constant) |
字符&
和!
是不變的 ISO-646下,但提供了使用這些字符無論如何,以適應(yīng)更加嚴(yán)格的歷史字符集運(yùn)營(yíng)商的替代品。
eq
對(duì)于相等運(yùn)算符沒有其他拼寫(如),==
因?yàn)樵撟址?code>=出現(xiàn)在所有支持的字符集中。
以下替代令牌是核心語言的一部分,并且在各方面的語言中,每個(gè)替代令牌的行為與其主令牌完全相同,但其拼寫(字符串操作符可以使拼寫可見)除外。兩個(gè)字母的替代令牌有時(shí)被稱為“二元符號(hào)”
Primary | Alternative |
---|---|
{ | <% |
} | %> |
[ | <: |
] | :> |
%: | |
%:%: |
在識(shí)別注釋和字符串文字之前,會(huì)分析以下三個(gè)字符組(trigraphs),并且每個(gè)三角形的外觀都會(huì)被相應(yīng)的主要字符替換:
Primary | Trigraph |
---|---|
{ | ??< |
} | ??> |
[ | ??( |
] | ??) |
??= | |
\ | ??/ |
^ | ??' |
| | ??! |
~ | ??- |
由于 trigraphs 被提前處理,所以注釋// Will the next line be executed?????/
會(huì)有效地注釋掉下面的行,并將字符串文字(比如"What's going on??!"
被解析為)注釋掉"What's going on|"
。
以下示例演示了<iso646.h>
頭文件中的替代運(yùn)算符拼寫以及使用二元和三元符。
第一個(gè)命令行參數(shù) argv1中的空格字符需要引號(hào):“,World!”。
%:include <stdlib.h>%:include <stdio.h>%:include <iso646.h> int main(int argc, char** argv)??< if (argc > 1 and argv<:1:> not_eq NULL) <% printf("Hello%s\n", argv<:1:>); %> return EXIT_SUCCESS;??>
可能的輸出:
Hello, World!