From 9907a84b263b79f7e2b518efea13e5cfd4dff271 Mon Sep 17 00:00:00 2001 From: Michele Caini Date: Tue, 17 Sep 2024 11:10:16 +0200 Subject: [PATCH] entity: noexcept-ness review --- src/entt/entity/mixin.hpp | 2 +- src/entt/entity/registry.hpp | 2 +- src/entt/entity/runtime_view.hpp | 6 +++--- src/entt/entity/sparse_set.hpp | 2 +- src/entt/entity/storage.hpp | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/entt/entity/mixin.hpp b/src/entt/entity/mixin.hpp index 648debd46..b498f4037 100644 --- a/src/entt/entity/mixin.hpp +++ b/src/entt/entity/mixin.hpp @@ -204,7 +204,7 @@ public: * @brief Exchanges the contents with those of a given storage. * @param other Storage to exchange the content with. */ - void swap(basic_sigh_mixin &other) { + void swap(basic_sigh_mixin &other) noexcept { using std::swap; swap(owner, other.owner); swap(construction, other.construction); diff --git a/src/entt/entity/registry.hpp b/src/entt/entity/registry.hpp index 31a8542f8..c270464b4 100644 --- a/src/entt/entity/registry.hpp +++ b/src/entt/entity/registry.hpp @@ -385,7 +385,7 @@ public: * @brief Exchanges the contents with those of a given registry. * @param other Registry to exchange the content with. */ - void swap(basic_registry &other) { + void swap(basic_registry &other) noexcept { using std::swap; swap(vars, other.vars); diff --git a/src/entt/entity/runtime_view.hpp b/src/entt/entity/runtime_view.hpp index 3e7e90e6f..202608ca3 100644 --- a/src/entt/entity/runtime_view.hpp +++ b/src/entt/entity/runtime_view.hpp @@ -163,7 +163,7 @@ public: filter{other.filter, allocator} {} /*! @brief Default move constructor. */ - basic_runtime_view(basic_runtime_view &&) noexcept(std::is_nothrow_move_constructible_v) = default; + basic_runtime_view(basic_runtime_view &&) noexcept = default; /** * @brief Allocator-extended move constructor. @@ -187,13 +187,13 @@ public: * @brief Default move assignment operator. * @return This runtime view. */ - basic_runtime_view &operator=(basic_runtime_view &&) noexcept(std::is_nothrow_move_assignable_v) = default; + basic_runtime_view &operator=(basic_runtime_view &&) noexcept = default; /** * @brief Exchanges the contents with those of a given view. * @param other View to exchange the content with. */ - void swap(basic_runtime_view &other) { + void swap(basic_runtime_view &other) noexcept { using std::swap; swap(pools, other.pools); swap(filter, other.filter); diff --git a/src/entt/entity/sparse_set.hpp b/src/entt/entity/sparse_set.hpp index 8f5f36044..1fa4fa010 100644 --- a/src/entt/entity/sparse_set.hpp +++ b/src/entt/entity/sparse_set.hpp @@ -482,7 +482,7 @@ public: * @brief Exchanges the contents with those of a given sparse set. * @param other Sparse set to exchange the content with. */ - void swap(basic_sparse_set &other) { + void swap(basic_sparse_set &other) noexcept { using std::swap; swap(sparse, other.sparse); swap(packed, other.packed); diff --git a/src/entt/entity/storage.hpp b/src/entt/entity/storage.hpp index b3e680d05..5d33999ed 100644 --- a/src/entt/entity/storage.hpp +++ b/src/entt/entity/storage.hpp @@ -487,7 +487,7 @@ public: * @brief Exchanges the contents with those of a given storage. * @param other Storage to exchange the content with. */ - void swap(basic_storage &other) { + void swap(basic_storage &other) noexcept { using std::swap; swap(payload, other.payload); base_type::swap(other);