repr
0.1
Reconstructable string representations and more
Loading...
Searching...
No Matches
reflection.h
Go to the documentation of this file.
1
#pragma once
2
#include <
concepts
>
3
#include <
string_view
>
4
5
// TODO decide whether to constrain has_custom_members to be a value list
6
// #include <librepr/util/collections/list.h>
7
8
namespace
librepr
{
9
// Reflection customization traits
10
11
template
<
typename
T>
12
struct
Settings;
13
14
template
<
typename
T>
15
concept
has_custom_members
= std::is_class_v<T> &&
requires
{
16
typename
Settings<T>::members;
17
//typename pack::rebox_v<T, ValueList>; // can rebox into ValueList -> members is a value list
18
};
19
20
template
<
typename
T>
21
concept
has_is_literal
= std::is_enum_v<T> &&
requires
(T
obj
) {
22
{ Settings<T>::is_literal } -> std::same_as<bool>;
23
};
24
25
template
<
typename
T>
26
concept
has_name
= std::is_enum_v<T> &&
requires
(T
obj
) {
27
{ Settings<T>::name } -> std::convertible_to<std::string_view>;
28
};
29
30
}
librepr::has_custom_members
Definition
reflection.h:15
librepr::has_is_literal
Definition
reflection.h:21
librepr::has_name
Definition
reflection.h:26
concepts
librepr
Definition
ctvi/ctvi.h:9
librepr::code_for
std::string code_for()
Definition
repr:39
string_view
include
librepr
customization
reflection.h
Generated by
1.9.8, using the excellent
Doxygen Awesome
Theme