diff --git a/src/entt/core/any.hpp b/src/entt/core/any.hpp index aa0dbc7be..c4ea97800 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 basic_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(sizeof...(Args) == 1u && (std::is_lvalue_reference_v && ...), "Invalid arguments"); mode = std::is_const_v> ? policy::cref : policy::ref; instance = (std::addressof(args), ...); - } else if constexpr(in_situ) { - if constexpr(sizeof...(Args) != 0u && std::is_aggregate_v) { - new(&storage) basic_type{std::forward(args)...}; + } else if constexpr(in_situ>>) { + if constexpr(sizeof...(Args) != 0u && std::is_aggregate_v>>) { + new(&storage) std::remove_cv_t>{std::forward(args)...}; } else { - new(&storage) basic_type(std::forward(args)...); + new(&storage) std::remove_cv_t>(std::forward(args)...); } } else { - if constexpr(sizeof...(Args) != 0u && std::is_aggregate_v) { - instance = new basic_type{std::forward(args)...}; + if constexpr(sizeof...(Args) != 0u && std::is_aggregate_v>>) { + instance = new std::remove_cv_t>{std::forward(args)...}; } else { - instance = new basic_type(std::forward(args)...); + instance = new std::remove_cv_t>(std::forward(args)...); } } } @@ -501,7 +500,7 @@ basic_any make_any(Args &&...args) { */ template::length, std::size_t Align = basic_any::alignment, typename Type> basic_any forward_as_any(Type &&value) { - return basic_any{std::in_place_type, std::forward(value)}; + return basic_any{std::in_place_type, std::forward(value)}; } } // namespace entt diff --git a/src/entt/meta/meta.hpp b/src/entt/meta/meta.hpp index 1757b2883..2cfa0a881 100644 --- a/src/entt/meta/meta.hpp +++ b/src/entt/meta/meta.hpp @@ -564,7 +564,7 @@ meta_any make_meta(Args &&...args) { */ template meta_any forward_as_meta(Type &&value) { - return meta_any{std::in_place_type, std::forward(value)}; + return meta_any{std::in_place_type, std::forward(value)}; } /**