1
0
Эх сурвалжийг харах

type_info: wrap ENTT_PRETTY_FUNCTION_PREFIX/SUFFIX with an ifdef

skypjack 9 сар өмнө
parent
commit
3b89567d77

+ 4 - 0
src/entt/core/type_info.hpp

@@ -32,10 +32,14 @@ template<typename Type>
 
 template<typename Type>
 [[nodiscard]] constexpr auto stripped_type_name() noexcept {
+#if defined ENTT_PRETTY_FUNCTION
     const std::string_view full_name{pretty_function<Type>()};
     auto first = full_name.find_first_not_of(' ', full_name.find_first_of(ENTT_PRETTY_FUNCTION_PREFIX) + 1);
     auto value = full_name.substr(first, full_name.find_last_of(ENTT_PRETTY_FUNCTION_SUFFIX) - first);
     return value;
+#else
+    return std::string_view{};
+#endif
 }
 
 template<typename Type, auto = stripped_type_name<Type>().find_first_of('.')>