Iros
Loading...
Searching...
No Matches
bit_tag.h
Go to the documentation of this file.
1
#pragma once
2
3
#include "
di/bit/bitset/prelude.h
"
4
#include "
di/meta/core.h
"
5
#include "
di/meta/operations.h
"
6
#include "
di/types/prelude.h
"
7
#include "
di/util/declval.h
"
8
9
namespace
di::meta
{
10
template
<
typename
T>
11
requires
(
requires
{
typename
T::Value; })
12
using
BitValue
= T::Value;
13
}
14
15
namespace
di::concepts
{
16
template
<
typename
T>
17
concept
BitTag
=
18
requires
{
typename
meta::BitValue<T>
; } &&
requires
(
meta::BitValue<T>
value,
BitSet<0>
bitset, T
const
tag) {
19
T::value_into_bits(bitset, value);
20
{ T::bits_into_value(bitset) } -> SameAs<meta::BitValue<T>>;
21
{ tag.get() } -> SameAs<meta::BitValue<T>>;
22
} &&
ConstructibleFrom<T, meta::BitValue<T>
>;
23
}
di::bit::BitSet
Definition
bit_set.h:11
di::concepts::BitTag
Definition
bit_tag.h:17
di::concepts::ConstructibleFrom
Definition
operations.h:11
core.h
declval.h
prelude.h
operations.h
prelude.h
di::concepts
Definition
any_storable.h:9
di::meta
Definition
merge_interfaces.h:6
di::meta::BitValue
T::Value BitValue
Definition
bit_tag.h:12
libs
di
include
di
bit
bitstruct
bit_tag.h
Generated by
1.13.0