Does C++, as an abstraction, support “bits” representing one of more than two values?

前端 未结 3 584
旧巷少年郎
旧巷少年郎 2021-02-14 00:23

[C++11: 1.7] talks about bytes in terms of bits:

The fundamental storage unit in the C++ memory model is the byte. A byte is at leas

3条回答
  •  南旧
    南旧 (楼主)
    2021-02-14 01:04

    Among the normative references listed in [C++11: 1.2] is "ISO/IEC 9899:1999, Programming languages — C".

    In turn, this standard says:

    [C99: 3.5]: 1 bit unit of data storage in the execution environment large enough to hold an object that may have one of two values

    This doesn't preclude a bit being a unit of data storage that's even larger, so C++ as a language indeed could support tri-state bits.

提交回复
热议问题