yfast
0.6.1
Loading...
Searching...
No Matches
concepts.h
1
#ifndef _YFAST_INTERNAL_CONCEPTS_H
2
#define _YFAST_INTERNAL_CONCEPTS_H
3
4
#include <concepts>
5
6
namespace
yfast::internal {
7
8
template
<
typename
Map,
typename
Key,
typename
Value>
9
concept
MapGeneric
=
requires
(Map map, Key key) {
10
{ map[key] } -> std::same_as<Value&>;
11
{ map.at(key) } -> std::convertible_to<Value>;
12
{ map.contains(key) } -> std::convertible_to<bool>;
13
{ map.erase(key) };
14
{ map.clear() };
15
};
16
17
template
<
typename
BitExtractor,
typename
Key>
18
concept
BitExtractorGeneric
=
requires
(
BitExtractor
bx, Key key,
unsigned
int
n) {
19
{ bx.extract_bit(key, n) } -> std::convertible_to<bool>;
20
{ bx.shift(key, n) } -> std::convertible_to<typename BitExtractor::ShiftResult>;
21
};
22
23
}
24
25
#endif
yfast::internal::BitExtractor
Definition
bit_extractor.h:14
yfast::internal::BitExtractorGeneric
Definition
concepts.h:18
yfast::internal::MapGeneric
Definition
concepts.h:9
include
yfast
internal
concepts.h
Generated by
1.14.0 with
doxygen-awesome
2.3.4