repr
0.1
Reconstructable string representations and more
Loading...
Searching...
No Matches
reflection/enum.h
Go to the documentation of this file.
1
#pragma once
2
#include <
type_traits
>
3
4
#include <
librepr/feature.h
>
5
#include <
librepr/macro/default.h
>
6
#include <
librepr/util/concepts.h
>
7
#include <
librepr/enum/reflect.h
>
8
9
#include "
category.h
"
10
11
namespace
librepr
{
12
template
<
typename
T>
13
struct
Reflect
;
14
15
template
<
typename
T>
16
requires
std::is_enum_v<T>
17
struct
Reflect
<T> : category::Type<T> {
18
using
type
= T;
19
constexpr
static
auto
enumerator_names =
librepr::enum_names<T>
();
20
constexpr
static
bool
can_descend =
false
;
21
// TODO enum values -> names mapping
22
23
template
<
typename
V>
24
static
void
visit
(V&&
visitor
, T&
obj
) {
25
visitor
(
category::Value
{
obj
});
26
}
27
};
28
29
}
// namespace librepr
category.h
concepts.h
default.h
reflect.h
feature.h
librepr
Definition
ctvi/ctvi.h:9
librepr::code_for
std::string code_for()
Definition
repr:39
librepr::Reflect
Reflect(T &) -> Reflect< T >
librepr::Reflect< T >::type
T type
Definition
aggregate.h:55
librepr::Reflect< T >::visit
static void visit(V &&visitor, T &obj)
Definition
reflection/enum.h:24
librepr::category::Value
Definition
category.h:49
type_traits
include
librepr
reflection
enum.h
Generated by
1.9.8, using the excellent
Doxygen Awesome
Theme