std::size_t size() const;
constexpr
返回 bitset 所保有的位数。
bitset
(无)
bitset 所保有的位数,即模板形参 N。
N
#include <bitset> #include <iostream> int main() { std::cout << std::bitset<0x400>().size() << '\n'; }
输出:
1024
true