Why is std::bitset<8> 4 bytes big?

前端 未结 7 2025
滥情空心
滥情空心 2021-01-18 17:54

It seems for std::bitset<1 to 32>, the size is set to 4 bytes. For sizes 33 to 64, it jumps straight up to 8 bytes. There can\'t be any overhead because std::bitset<

7条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-18 18:36

    Maybe because it's using int by default, and switches to long long if it overflows? (Just a guess...)

提交回复
热议问题