ソースを参照

sparse_set/storage: make it clear that dtor and move op are not noexcept

Michele Caini 1 年間 前
コミット
d0a23fdf49
4 ファイル変更6 行追加5 行削除
  1. 1 0
      TODO
  2. 1 1
      src/entt/entity/group.hpp
  3. 2 2
      src/entt/entity/sparse_set.hpp
  4. 2 2
      src/entt/entity/storage.hpp

+ 1 - 0
TODO

@@ -45,3 +45,4 @@ TODO:
 * view and view iterator specializations for multi, single and filtered elements
 * organizer support to groups
 * meta range: move id to meta objects and return plain types (?), then remove id from meta base and meta ctor too
+* noexcept move op for sparse set and storage

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

@@ -93,7 +93,7 @@ template<typename... Lhs, typename... Rhs>
 
 struct group_descriptor {
     using size_type = std::size_t;
-    virtual ~group_descriptor() noexcept = default;
+    virtual ~group_descriptor() noexcept(false) = default;
     [[nodiscard]] virtual bool owned(const id_type) const noexcept {
         return false;
     }

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

@@ -453,7 +453,7 @@ public:
     }
 
     /*! @brief Default destructor. */
-    virtual ~basic_sparse_set() noexcept {
+    virtual ~basic_sparse_set() noexcept(false) {
         release_sparse_pages();
     }
 
@@ -468,7 +468,7 @@ public:
      * @param other The instance to move from.
      * @return This sparse set.
      */
-    basic_sparse_set &operator=(basic_sparse_set &&other) noexcept {
+    basic_sparse_set &operator=(basic_sparse_set &&other) noexcept(false) {
         ENTT_ASSERT(alloc_traits::is_always_equal::value || get_allocator() == other.get_allocator(), "Copying a sparse set is not allowed");
 
         release_sparse_pages();

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

@@ -461,7 +461,7 @@ public:
     }
 
     /*! @brief Default destructor. */
-    ~basic_storage() noexcept override {
+    ~basic_storage() noexcept(false) override {
         shrink_to_size(0u);
     }
 
@@ -476,7 +476,7 @@ public:
      * @param other The instance to move from.
      * @return This storage.
      */
-    basic_storage &operator=(basic_storage &&other) noexcept {
+    basic_storage &operator=(basic_storage &&other) noexcept(false) {
         ENTT_ASSERT(alloc_traits::is_always_equal::value || get_allocator() == other.get_allocator(), "Copying a storage is not allowed");
         shrink_to_size(0u);
         payload = std::move(other.payload);