67#include "../thirdparty/nameof.h"
90[[nodiscard]]
constexpr bool is_support()
noexcept;
113[[nodiscard]]
constexpr std::string_view
get()
noexcept;
128[[nodiscard]] std::string_view
get_enum(T e)
noexcept;
138 if constexpr (nameof::detail::nameof_type_supported<T>::value) {
147#if defined(_WIN32) || defined(__CYGWIN__)
148 std::string_view type_sv = nameof::nameof_type<T>();
150 constexpr std::string_view kStructPrefix =
"struct ";
151 if (type_sv.rfind(kStructPrefix, 0) == 0) {
152 type_sv.remove_prefix(kStructPrefix.length());
155 constexpr std::string_view kClassPrefix =
"class ";
156 if (type_sv.rfind(kClassPrefix, 0) == 0) {
157 type_sv.remove_prefix(kClassPrefix.length());
162 return nameof::nameof_type<T>();
168 return nameof::nameof_enum(e);
Compile-time type-name and enum-name detection utilities.
std::string_view get_enum(T e) noexcept
Returns the string representation of an enumeration value e.
Definition name_detector.h:167
constexpr bool is_support() noexcept
Checks at compile time whether the nameof library can produce a type name for T.
Definition name_detector.h:137
constexpr std::string_view get() noexcept
Returns the unqualified compile-time name of type T as a std::string_view.
Definition name_detector.h:146