C++ 中 int 的最小大小是多少?

What is the minimum size of an int in C++?

Cppreference.com 声明:

If no length modifiers are present, it's guaranteed to have a width of at least 16 bits.

然而,最新的标准草案只说:

Plain ints have the natural size suggested by the architecture of the execution environment.

仅添加脚注:

int must also be large enough to contain any value in the range [INT_­MIN, INT_­MAX], as defined in the header <climits>.

从标准的这些部分来看,int 的大小似乎完全取决于实现。 “最低 16 位”保证从何而来?

int 的最小大小符合 INT_MIN 不得小于 -32767INT_MAX 至少为 +32767 的要求。请注意,这是 2^16-1 个可能的值,它允许 1 的补码与带符号的零表示。