diff --git a/src/entt/core/any.hpp b/src/entt/core/any.hpp index 7528e9cd9..cf1eeff5c 100644 --- a/src/entt/core/any.hpp +++ b/src/entt/core/any.hpp @@ -122,27 +122,26 @@ class basic_any { template void initialize([[maybe_unused]] Args &&...args) { - using plain_type = std::remove_cv_t>; - info = &type_id(); + info = &type_id>>(); if constexpr(!std::is_void_v) { - vtable = basic_vtable; + vtable = basic_vtable>>; if constexpr(std::is_lvalue_reference_v) { static_assert((std::is_lvalue_reference_v && ...) && (sizeof...(Args) == 1u), "Invalid arguments"); mode = std::is_const_v> ? policy::cref : policy::ref; instance = (std::addressof(args), ...); - } else if constexpr(in_situ) { - if constexpr(std::is_aggregate_v && (sizeof...(Args) != 0u || !std::is_default_constructible_v)) { - new(&storage) plain_type{std::forward(args)...}; + } else if constexpr(in_situ>>) { + if constexpr(std::is_aggregate_v>> && (sizeof...(Args) != 0u || !std::is_default_constructible_v>>)) { + new(&storage) std::remove_cv_t>{std::forward(args)...}; } else { - new(&storage) plain_type(std::forward(args)...); + new(&storage) std::remove_cv_t>(std::forward(args)...); } } else { - if constexpr(std::is_aggregate_v && (sizeof...(Args) != 0u || !std::is_default_constructible_v)) { - instance = new plain_type{std::forward(args)...}; + if constexpr(std::is_aggregate_v>> && (sizeof...(Args) != 0u || !std::is_default_constructible_v>>)) { + instance = new std::remove_cv_t>{std::forward(args)...}; } else { - instance = new plain_type(std::forward(args)...); + instance = new std::remove_cv_t>(std::forward(args)...); } } }