Browse Source

entity: noexcept-ness review

Michele Caini 1 year ago
parent
commit
9907a84b26

+ 1 - 1
src/entt/entity/mixin.hpp

@@ -204,7 +204,7 @@ public:
      * @brief Exchanges the contents with those of a given storage.
      * @brief Exchanges the contents with those of a given storage.
      * @param other Storage to exchange the content with.
      * @param other Storage to exchange the content with.
      */
      */
-    void swap(basic_sigh_mixin &other) {
+    void swap(basic_sigh_mixin &other) noexcept {
         using std::swap;
         using std::swap;
         swap(owner, other.owner);
         swap(owner, other.owner);
         swap(construction, other.construction);
         swap(construction, other.construction);

+ 1 - 1
src/entt/entity/registry.hpp

@@ -385,7 +385,7 @@ public:
      * @brief Exchanges the contents with those of a given registry.
      * @brief Exchanges the contents with those of a given registry.
      * @param other Registry to exchange the content with.
      * @param other Registry to exchange the content with.
      */
      */
-    void swap(basic_registry &other) {
+    void swap(basic_registry &other) noexcept {
         using std::swap;
         using std::swap;
 
 
         swap(vars, other.vars);
         swap(vars, other.vars);

+ 3 - 3
src/entt/entity/runtime_view.hpp

@@ -163,7 +163,7 @@ public:
           filter{other.filter, allocator} {}
           filter{other.filter, allocator} {}
 
 
     /*! @brief Default move constructor. */
     /*! @brief Default move constructor. */
-    basic_runtime_view(basic_runtime_view &&) noexcept(std::is_nothrow_move_constructible_v<container_type>) = default;
+    basic_runtime_view(basic_runtime_view &&) noexcept = default;
 
 
     /**
     /**
      * @brief Allocator-extended move constructor.
      * @brief Allocator-extended move constructor.
@@ -187,13 +187,13 @@ public:
      * @brief Default move assignment operator.
      * @brief Default move assignment operator.
      * @return This runtime view.
      * @return This runtime view.
      */
      */
-    basic_runtime_view &operator=(basic_runtime_view &&) noexcept(std::is_nothrow_move_assignable_v<container_type>) = default;
+    basic_runtime_view &operator=(basic_runtime_view &&) noexcept = default;
 
 
     /**
     /**
      * @brief Exchanges the contents with those of a given view.
      * @brief Exchanges the contents with those of a given view.
      * @param other View to exchange the content with.
      * @param other View to exchange the content with.
      */
      */
-    void swap(basic_runtime_view &other) {
+    void swap(basic_runtime_view &other) noexcept {
         using std::swap;
         using std::swap;
         swap(pools, other.pools);
         swap(pools, other.pools);
         swap(filter, other.filter);
         swap(filter, other.filter);

+ 1 - 1
src/entt/entity/sparse_set.hpp

@@ -482,7 +482,7 @@ public:
      * @brief Exchanges the contents with those of a given sparse set.
      * @brief Exchanges the contents with those of a given sparse set.
      * @param other Sparse set to exchange the content with.
      * @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;
         using std::swap;
         swap(sparse, other.sparse);
         swap(sparse, other.sparse);
         swap(packed, other.packed);
         swap(packed, other.packed);

+ 1 - 1
src/entt/entity/storage.hpp

@@ -487,7 +487,7 @@ public:
      * @brief Exchanges the contents with those of a given storage.
      * @brief Exchanges the contents with those of a given storage.
      * @param other Storage to exchange the content with.
      * @param other Storage to exchange the content with.
      */
      */
-    void swap(basic_storage &other) {
+    void swap(basic_storage &other) noexcept {
         using std::swap;
         using std::swap;
         swap(payload, other.payload);
         swap(payload, other.payload);
         base_type::swap(other);
         base_type::swap(other);