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
enum/reflect.h
Go to the documentation of this file.
#pragma once
#include <
type_traits
>
#include <
string_view
>
#include <
librepr/macro/default.h
>
#if USING(REPR_USE_MAGIC_ENUM)
#if __has_include(<magic_enum.hpp>)
// include name used when pulling in magic_enum through conan
#include <magic_enum.hpp>
#elif __has_include(<magic_enum/magic_enum.hpp>)
// compiler explorer uses this include name
#include <magic_enum/magic_enum.hpp>
#else
#error "Configured to use magic_enum but could not find magic_enum"
#endif
#else
#include "
search.h
"
#endif
namespace
librepr
{
template
<
typename
T>
requires
std::is_enum_v<T>
[[
nodiscard
]]
constexpr
auto
enum_names
()
noexcept
{
#if USING(REPR_USE_MAGIC_ENUM)
return
magic_enum::enum_names<T>();
#else
return
ctei::dump_enum<T>::get_names
();
#endif
}
[[
nodiscard
]]
constexpr
auto
enum_names
()
noexcept
{
…
}
template
<
typename
T>
requires
std::is_enum_v<T>
[[
nodiscard
]]
constexpr
auto
enum_name
(T value)
noexcept
{
#if USING(REPR_USE_MAGIC_ENUM)
return
magic_enum::enum_name(value);
#else
return
ctei::dump_enum<T>::get_name
(value);
#endif
}
[[
nodiscard
]]
constexpr
auto
enum_name
(T value)
noexcept
{
…
}
template
<auto V>
requires
std::is_enum_v
<
decltype
(V)>
[[
nodiscard
]]
constexpr
std::string_view
enum_name
()
noexcept
{
#if USING(REPR_USE_MAGIC_ENUM)
return
magic_enum::enum_name<V>();
#else
// TODO
return
ctei::enum_name
<
decltype
(V), V>.data();
#endif
}
[[
nodiscard
]]
constexpr
std::string_view
enum_name
()
noexcept
{
…
}
}
include
librepr
enum
reflect.h
Generated by
1.9.8, using the excellent
Doxygen Awesome
Theme