From 1a99326b4c57d288cd671977e066df1499804c8c Mon Sep 17 00:00:00 2001 From: Ricardo Antunes Date: Wed, 13 Sep 2023 13:41:33 +0100 Subject: [PATCH] fix(core): try moving trait on Type::with --- core/include/cubos/core/reflection/type.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/include/cubos/core/reflection/type.hpp b/core/include/cubos/core/reflection/type.hpp index cf127dfd85..bf3b768fec 100644 --- a/core/include/cubos/core/reflection/type.hpp +++ b/core/include/cubos/core/reflection/type.hpp @@ -56,7 +56,8 @@ namespace cubos::core::reflection template Type& with(T trait) { - return this->with(Type::id(), new T(trait), [](void* trait) { delete static_cast(trait); }); + return this->with(Type::id(), new T(static_cast(trait)), + [](void* trait) { delete static_cast(trait); }); } /// @brief Returns whether the type has the given trait.