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>
8
9#include "category.h"
10
11namespace librepr {
12template <typename T>
13struct Reflect;
14
15template <typename T>
16 requires std::is_enum_v<T>
17struct 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) {
26 }
27};
28
29} // namespace librepr
Definition ctvi/ctvi.h:9
std::string code_for()
Definition repr:39
Reflect(T &) -> Reflect< T >
T type
Definition aggregate.h:55
static void visit(V &&visitor, T &obj)
Definition reflection/enum.h:24
Definition category.h:49