wowlib 0.0.0
Read & write World of Warcraft client files — a C++26 core
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
11namespace 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}
constexpr std::string_view enumName(E value)
The enumerator name of value, straight from reflection — no handwritten stringification tables anywhe...
Definition reflect.hpp:19