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
6
namespace
brstd {
7
8
template
<std::
size_t
Bits,
typename
UnderlyingType>
9
constexpr
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
16
template
<std::
size_t
Bits,
typename
UnderlyingType>
17
class
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 =
22
typename
detail::bitset_base<bitset, std::array<UnderlyingType, num_values>
>::underlying_type;
23
};
24
25
}
// namespace brstd
brstd::bitset
Definition
bitset.h:19
brstd::detail::bitset_base
Definition
bitset_base.h:8
src-server
mc
platform
brstd
bitset.h
Generated on Tue Nov 25 2025 04:01:20 for LeviLamina by
1.12.0