被人忽略的 signed 关键字
int i = 0; signed int i = 0;
我查阅了 C++11 的标准文档(草稿N3690)，发现一些端倪：
3.9.1 Fundamental types
Objects declared as characters(char) shall be large enough to store any member of the implementation’s basic character set. If a character from this set is stored in a character object, the integral value of that character object is equal to the value of the single character literal form of that character. It is implementation-deﬁned whether a char object can hold negative values. Characters can be explicitly declared unsigned or signed. Plain char, signed char, and unsigned char are three distinct types, collectively called narrow character types. A char,a signed char,and an unsigned char occupy the same amount of storage and have the same alignment requirements(3.11); that is,they have the same object representation. For narrow character types, all bits of the object representation participate in the value representation. For unsigned narrow character types, all possible bit patterns of the value representation represent numbers. These requirements do not hold for other types. In any particular implementation, a plain char object can take on either the same values as a signed char or an unsigned char; which one is implementation-deﬁned.
signed char 和
unsigned char 是三种不同的类型。
再看看 C11 的标准文档(ISO/IEC 9899:201x)呢？
6.7.2 Type speciﬁers
Each of the comma-separated multisets designates the same type, except that for bit-ﬁelds, it is implementation-deﬁned whether the speciﬁer int designates the same type as signed int or the same type as unsigned int.
bit-fields (位域) 也存在同样的问题。(位域的概念可能也有点偏，经常写比较底层的接口或协议童鞋应该熟悉，可参考这里)
在 C/C++ 中，