Given the typedef value for std::bitset
some size, I need to determine this size at compile time. For instance:
typedef std::bitset<37> permission_bits; static_assert(permission_bits::size() == 37, "size must be 37");
The above is a little far-fetched, but shows a common problem.
As far as I can see in the standard, there is no static constexpr member from std::bitset
which will allow me to extract the size. Did I miss something? And if not, what can I do to extract size at compile time?
source share