LeviLamina
Loading...
Searching...
No Matches
bitset.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4#include "mc/platform/brstd/detail/bitset_base.h"
5
6namespace brstd {
7
8template <std::size_t Bits, typename UnderlyingType>
9constexpr std::size_t get_num_values() {
10 static_assert(std::is_integral_v<UnderlyingType>, "UnderlyingType must be an integral type.");
11 static_assert(Bits > 0, "Bits must be greater than zero.");
12 constexpr std::size_t bits_per_type = sizeof(UnderlyingType) * 8;
13 return (Bits + bits_per_type - 1) / bits_per_type;
14}
15
16template <std::size_t Bits, typename UnderlyingType>
17class bitset
18: public detail::
19 bitset_base<bitset<Bits, UnderlyingType>, std::array<UnderlyingType, get_num_values<Bits, UnderlyingType>()>> {
20 static constexpr size_t num_values = get_num_values<Bits, UnderlyingType>();
21 using underlying_type =
23};
24
25} // namespace brstd
Definition bitset.h:19
Definition bitset_base.h:8