Why does std::bitset expose bits in little-endian fashion?

后端 未结 2 625
一向
一向 2020-12-20 15:28

When I use std::bitset::bitset( unsigned long long ) this constructs a bitset and when I access it via the operator[], the bits seems to b

2条回答
  •  情深已故
    2020-12-20 16:00

    This is consistent with the way bits are usually numbered - bit 0 represents 20, bit 1 represents 21, etc. It has nothing to do with the endianness of the architecture, which concerns byte ordering not bit ordering.

提交回复
热议问题