Преглед на файлове

type_info: wrap ENTT_PRETTY_FUNCTION_PREFIX/SUFFIX with an ifdef

skypjack преди 9 месеца
родител
ревизия
3b89567d77
променени са 1 файла, в които са добавени 4 реда и са изтрити 0 реда
  1. 4 0
      src/entt/core/type_info.hpp

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

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