|
@@ -449,21 +449,24 @@ public:
|
|
|
* @brief Move constructor.
|
|
* @brief Move constructor.
|
|
|
* @param other The instance to move from.
|
|
* @param other The instance to move from.
|
|
|
*/
|
|
*/
|
|
|
|
|
+ // NOLINTBEGIN(bugprone-use-after-move)
|
|
|
basic_storage(basic_storage &&other) noexcept
|
|
basic_storage(basic_storage &&other) noexcept
|
|
|
- : base_type{static_cast<base_type &&>(other)},
|
|
|
|
|
|
|
+ : base_type{std::move(other)},
|
|
|
payload{std::move(other.payload)} {}
|
|
payload{std::move(other.payload)} {}
|
|
|
|
|
+ // NOLINTEND(bugprone-use-after-move)
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* @brief Allocator-extended move constructor.
|
|
* @brief Allocator-extended move constructor.
|
|
|
* @param other The instance to move from.
|
|
* @param other The instance to move from.
|
|
|
* @param allocator The allocator to use.
|
|
* @param allocator The allocator to use.
|
|
|
*/
|
|
*/
|
|
|
|
|
+ // NOLINTBEGIN(bugprone-use-after-move)
|
|
|
basic_storage(basic_storage &&other, const allocator_type &allocator)
|
|
basic_storage(basic_storage &&other, const allocator_type &allocator)
|
|
|
- : base_type{static_cast<base_type &&>(other), allocator},
|
|
|
|
|
|
|
+ : base_type{std::move(other), allocator},
|
|
|
payload{std::move(other.payload), allocator} {
|
|
payload{std::move(other.payload), allocator} {
|
|
|
- // NOLINTNEXTLINE(bugprone-use-after-move)
|
|
|
|
|
ENTT_ASSERT(alloc_traits::is_always_equal::value || get_allocator() == other.get_allocator(), "Copying a storage is not allowed");
|
|
ENTT_ASSERT(alloc_traits::is_always_equal::value || get_allocator() == other.get_allocator(), "Copying a storage is not allowed");
|
|
|
}
|
|
}
|
|
|
|
|
+ // NOLINTEND(bugprone-use-after-move)
|
|
|
|
|
|
|
|
/*! @brief Default destructor. */
|
|
/*! @brief Default destructor. */
|
|
|
// NOLINTNEXTLINE(bugprone-exception-escape)
|
|
// NOLINTNEXTLINE(bugprone-exception-escape)
|
|
@@ -1055,18 +1058,22 @@ public:
|
|
|
* @brief Move constructor.
|
|
* @brief Move constructor.
|
|
|
* @param other The instance to move from.
|
|
* @param other The instance to move from.
|
|
|
*/
|
|
*/
|
|
|
|
|
+ // NOLINTBEGIN(bugprone-use-after-move)
|
|
|
basic_storage(basic_storage &&other) noexcept
|
|
basic_storage(basic_storage &&other) noexcept
|
|
|
- : base_type{static_cast<base_type &&>(other)},
|
|
|
|
|
|
|
+ : base_type{std::move(other)},
|
|
|
placeholder{other.placeholder} {}
|
|
placeholder{other.placeholder} {}
|
|
|
|
|
+ // NOLINTEND(bugprone-use-after-move)
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* @brief Allocator-extended move constructor.
|
|
* @brief Allocator-extended move constructor.
|
|
|
* @param other The instance to move from.
|
|
* @param other The instance to move from.
|
|
|
* @param allocator The allocator to use.
|
|
* @param allocator The allocator to use.
|
|
|
*/
|
|
*/
|
|
|
|
|
+ // NOLINTBEGIN(bugprone-use-after-move)
|
|
|
basic_storage(basic_storage &&other, const allocator_type &allocator)
|
|
basic_storage(basic_storage &&other, const allocator_type &allocator)
|
|
|
- : base_type{static_cast<base_type &&>(other), allocator},
|
|
|
|
|
|
|
+ : base_type{std::move(other), allocator},
|
|
|
placeholder{other.placeholder} {}
|
|
placeholder{other.placeholder} {}
|
|
|
|
|
+ // NOLINTEND(bugprone-use-after-move)
|
|
|
|
|
|
|
|
/*! @brief Default destructor. */
|
|
/*! @brief Default destructor. */
|
|
|
~basic_storage() override = default;
|
|
~basic_storage() override = default;
|