signal: swap based move assignment operators
This commit is contained in:
@@ -194,7 +194,7 @@ public:
|
||||
*/
|
||||
basic_dispatcher &operator=(basic_dispatcher &&other) noexcept {
|
||||
ENTT_ASSERT(alloc_traits::is_always_equal::value || get_allocator() == other.get_allocator(), "Copying a dispatcher is not allowed");
|
||||
pools = std::move(other.pools);
|
||||
swap(other);
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
@@ -96,7 +96,7 @@ public:
|
||||
*/
|
||||
emitter &operator=(emitter &&other) noexcept {
|
||||
ENTT_ASSERT(alloc_traits::is_always_equal::value || handlers.second() == other.handlers.second(), "Copying an emitter is not allowed");
|
||||
handlers = std::move(other.handlers);
|
||||
swap(other);
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
@@ -125,8 +125,8 @@ public:
|
||||
* @param other The instance to move from.
|
||||
* @return This signal handler.
|
||||
*/
|
||||
sigh &operator=(sigh &&other) noexcept(std::is_nothrow_move_assignable_v<container_type>) {
|
||||
calls = std::move(other.calls);
|
||||
sigh &operator=(sigh &&other) noexcept(std::is_nothrow_swappable_v<container_type>) {
|
||||
swap(other);
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user