C++ 对字 rune 字的顺序有什么保证? 基本源字符集中的字符有明确的顺序吗? (例如 'a' < 'z'
保证是真的吗?'A' < 'z'
怎么样?)
最佳答案
该标准仅保证十进制数字 0
到 9
的顺序,来自草案 C++11 标准部分 2.3
[lex.charset]:
In both the source and execution basic character sets, the value of each character after 0 in the above list of decimal digits shall be one greater than the value of the previous.
否则说(强调我的):
The basic execution character set and the basic execution wide-character set shall each contain all the members of the basic source character set, plus control characters representing alert, backspace, and carriage return, plus a null character (respectively, null wide character), whose representation has all zero bits. For each basic execution character set, the values of the members shall be non-negative and distinct from one another.
请注意,EBCDIC具有非连续字符集。
关于c++ - C++ 对字 rune 字的顺序有什么保证?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32586834/