Skip to content

Commit

Permalink
refactor(core): remove vector include
Browse files Browse the repository at this point in the history
  • Loading branch information
RiscadoA committed Sep 10, 2023
1 parent 23f853c commit 41cbd23
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions core/include/cubos/core/reflection/traits/constructible.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

#pragma once

#include <vector>
#include <cstddef>

namespace cubos::core::reflection
{
Expand Down Expand Up @@ -123,15 +123,15 @@ namespace cubos::core::reflection
/// @return Constructed trait.
ConstructibleTrait build() &&
{
return std::move(mTrait);
return mTrait;
}

/// @brief Sets the copy constructor of the type.
/// @return Reference to this object.
Builder&& withDefaultConstructor() &&
{
mTrait.withDefaultConstructor([](void* instance) { new (instance) T(); });
return std::move(*this);
return static_cast<Builder&&>(*this);
}

/// @brief Sets the copy constructor of the type.
Expand All @@ -140,16 +140,16 @@ namespace cubos::core::reflection
{
mTrait.withCopyConstructor(
[](void* instance, const void* other) { new (instance) T(*static_cast<const T*>(other)); });
return std::move(*this);
return static_cast<Builder&&>(*this);
}

/// @brief Sets the move constructor of the type.
/// @return Reference to this object.
Builder&& withMoveConstructor() &&
{
mTrait.withMoveConstructor(
[](void* instance, void* other) { new (instance) T(std::move(*static_cast<T*>(other))); });
return std::move(*this);
[](void* instance, void* other) { new (instance) T(static_cast<T&&>(*static_cast<T*>(other))); });
return static_cast<Builder&&>(*this);
}

private:
Expand Down

0 comments on commit 41cbd23

Please sign in to comment.