c++ - C++ 对字 rune 字的顺序有什么保证?

标签 c++ c++11 character-encoding char character

C++ 对字 rune 字的顺序有什么保证? 基本源字符集中的字符有明确的顺序吗? (例如 'a' < 'z' 保证是真的吗?'A' < 'z' 怎么样?)

最佳答案

该标准仅保证十进制数字 09 的顺序,来自草案 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/

相关文章:

c++ - Qt正确的无主QObject返回语义

c++ - 使用 char* 类型的 static_cast 获取地址,并获取 24 位和 48 位地址

c++ - 将 _HAS_ITERATOR_DEBUGGING 设置为 0

c++ - 指针是指向单个项目还是指向数组?

c++ - 没有模板的运算符重载

php - 如何对波兰语字符进行编码

java - 为什么 Files.readAllBytes() 不接受编码参数?

c++ - 计算字符串 vector 中单词的出现次数

c++ - 以宽松的顺序读取共享变量 : is it possible in theory? 在 C++ 中是否可能?

java - 将 XML 发送到 JMS 时,我应该使用 TextMessage 还是 BytesMessage