diff --git a/src/entt/core/type_info.hpp b/src/entt/core/type_info.hpp index 029a973f9..827bbb1eb 100644 --- a/src/entt/core/type_info.hpp +++ b/src/entt/core/type_info.hpp @@ -254,8 +254,12 @@ private: */ template [[nodiscard]] const type_info &type_id() ENTT_NOEXCEPT { - static type_info instance{std::in_place_type>>}; - return instance; + if constexpr(std::is_same_v>>) { + static type_info instance{std::in_place_type>>}; + return instance; + } else { + return type_id>>(); + } } } // namespace entt