Skip to content

Commit

Permalink
mixin: avoid use-after-move (wrong) warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
skypjack committed Jan 27, 2025
1 parent 25dff4b commit a5d4611
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/entt/entity/mixin.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -454,22 +454,26 @@ class basic_reactive_mixin final: public Type {
* @brief Move constructor.
* @param other The instance to move from.
*/
// NOLINTBEGIN(bugprone-use-after-move)
basic_reactive_mixin(basic_reactive_mixin &&other) noexcept
: underlying_type{std::move(other)},
owner{other.owner},
conn{} {
}
// NOLINTEND(bugprone-use-after-move)

/**
* @brief Allocator-extended move constructor.
* @param other The instance to move from.
* @param allocator The allocator to use.
*/
// NOLINTBEGIN(bugprone-use-after-move)
basic_reactive_mixin(basic_reactive_mixin &&other, const allocator_type &allocator)
: underlying_type{std::move(other), allocator},
owner{other.owner},
conn{allocator} {
}
// NOLINTEND(bugprone-use-after-move)

/*! @brief Default destructor. */
~basic_reactive_mixin() override = default;
Expand Down

0 comments on commit a5d4611

Please sign in to comment.