7template<
size_t index,
size_t bit_count>
8requires(bit_count <= 63)
12 template<
size_t bit_size>
14 for (
size_t i = 0; i < bit_count; i++) {
15 bit_set[index + i] = !!(value & (1ULL << i));
19 template<
size_t bit_size>
21 auto result =
Value { 0 };
22 for (
size_t i = 0; i < bit_count; i++) {
23 result |= (bit_set[index + i] << i);
29 constexpr auto get() const ->
Value {
return m_value; }
Definition bit_proxy_reference.h:5
decltype(detail::smallest_unsigned_type_helper(c_< size >)) SmallestUnsignedType
Definition smallest_unsigned_type.h:27
Definition zstring_parser.h:9
constexpr auto get() const -> Value
Definition bit_field.h:29
constexpr BitField(Value value)
Definition bit_field.h:28
static constexpr auto bits_into_value(BitSet< bit_size > const &bit_set) -> Value
Definition bit_field.h:20
math::SmallestUnsignedType<(1ULL<< bit_count) - 1 > Value
Definition bit_field.h:10
static constexpr void value_into_bits(BitSet< bit_size > &bit_set, Value value)
Definition bit_field.h:13