repr
0.1
Reconstructable string representations and more
Toggle main menu visibility
Main Page
Installation
Usage
Customization
Extending
FAQ
CI Results
Test
Benchmark
API Documentation
Namespace List
Namespace List
Namespace Members
All
_
a
c
d
e
f
g
i
l
m
n
o
p
r
s
t
u
v
w
Functions
_
a
c
d
e
f
g
i
l
m
n
o
r
s
t
u
v
w
Variables
Typedefs
Enumerations
Concept List
Class List
Class List
Class Index
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
~
Functions
_
a
c
e
f
g
i
l
m
n
o
p
r
s
t
v
w
~
Variables
a
b
c
d
e
f
g
i
k
l
m
n
o
p
q
r
s
t
u
v
Typedefs
a
c
d
e
f
g
h
l
m
p
r
s
t
u
v
w
Enumerations
Enumerator
Related Symbols
File List
File List
File Members
All
_
l
n
o
r
u
Variables
Macros
_
l
o
r
u
Examples
Source Code
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
Concepts
Loading...
Searching...
No Matches
range_list.h
Go to the documentation of this file.
#pragma once
#include <
type_traits
>
#include <
librepr/util/collections/list.h
>
#include "
range.h
"
#include "
util.h
"
namespace
librepr::ctei
{
template
<
typename
...
Ranges
>
struct
RangeList
:
TypeListBase
<RangeList, Ranges...>{
using
last
=
typename
RangeList::template
get<0>
;
constexpr
static
auto
next_index
= last::max + 1;
template
<auto Idx>
using
add
=
std::conditional_t
<
next_index
==
Idx
,
typename
RangeList::template
tail<0>::template
prepend<typename last::template expand<1>
>,
typename
RangeList::template
prepend<Range<Idx>
>
>;
template
<
typename
T>
using
add_range
=
std::conditional_t
<
next_index
== T::min,
typename
RangeList::template
tail<0>::template
prepend<typename last::template expand<T::size>
>,
typename
RangeList::template
prepend<T>
>;
template
<
typename
T, auto V, auto Idx = V>
using
try_one
=
std::conditional_t<is_enum_value<T, V>
(),
add<Idx>
,
RangeList
>;
constexpr
static
bool
is_binary_powers
(){
return
(Ranges::is_binary_powers() && ...);
}
constexpr
static
bool
is_binary_powers
() {
…
}
};
struct
RangeList
:
TypeListBase
<RangeList, Ranges...> {
…
};
template
<>
struct
RangeList
<> :
TypeListBase
<RangeList> {
constexpr
static
auto
full_size = 0;
template
<auto Index>
using
add
=
RangeList<Range<Index>
>;
template
<
typename
T>
using
add_range
=
RangeList<T>
;
template
<
typename
T, auto V, auto Idx = V>
using
try_one
=
std::conditional_t<is_enum_value<T, V>
(),
add<Idx>
,
RangeList
>;
constexpr
static
bool
is_binary_powers
(){
// special case empty range list to detect flags outside of initial search range
return
true
;
}
constexpr
static
bool
is_binary_powers
() {
…
}
};
struct
RangeList
<> :
TypeListBase
<RangeList> {
…
};
}
// namespace librepr::ctei
include
librepr
enum
range_list.h
Generated by
1.9.8, using the excellent
Doxygen Awesome
Theme