wowlib
0.0.0
Read & write World of Warcraft client files — a C++26 core
Toggle main menu visibility
Loading...
Searching...
No Matches
reflect.hpp
Go to the documentation of this file.
1
#pragma once
2
6
7
#include <meta>
8
#include <string_view>
9
#include <type_traits>
10
11
namespace
wowlib
{
18
template
<
typename
E>
requires
std::is_enum_v<E>
19
constexpr
std::string_view
enumName
(E value) {
20
template
for
(
constexpr
auto
e : std::define_static_array(std::meta::enumerators_of(^^E))) {
21
if
(value == [:e:])
return
std::meta::identifier_of(e);
22
}
23
return
"<unknown>"
;
24
}
25
}
wowlib
Definition
detail.hpp:29
wowlib::enumName
constexpr std::string_view enumName(E value)
The enumerator name of value, straight from reflection — no handwritten stringification tables anywhe...
Definition
reflect.hpp:19
src
wowlib
core
reflect.hpp
Generated by
1.17.0