Skip to content

Commit

Permalink
fix(core): try moving trait on Type::with
Browse files Browse the repository at this point in the history
  • Loading branch information
RiscadoA committed Sep 13, 2023
1 parent 98b94d8 commit 1a99326
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion core/include/cubos/core/reflection/type.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ namespace cubos::core::reflection
template <typename T>
Type& with(T trait)
{
return this->with(Type::id<T>(), new T(trait), [](void* trait) { delete static_cast<T*>(trait); });
return this->with(Type::id<T>(), new T(static_cast<T&&>(trait)),
[](void* trait) { delete static_cast<T*>(trait); });
}

/// @brief Returns whether the type has the given trait.
Expand Down

0 comments on commit 1a99326

Please sign in to comment.