瀏覽代碼

mixin: refine noexcept-ness

Michele Caini 1 年之前
父節點
當前提交
c3826c78aa
共有 1 個文件被更改,包括 3 次插入3 次删除
  1. 3 3
      src/entt/entity/mixin.hpp

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

@@ -117,7 +117,7 @@ public:
      * @brief Move constructor.
      * @brief Move constructor.
      * @param other The instance to move from.
      * @param other The instance to move from.
      */
      */
-    basic_sigh_mixin(basic_sigh_mixin &&other) noexcept
+    basic_sigh_mixin(basic_sigh_mixin &&other) noexcept(noexcept(underlying_type{std::move(other)}))
         : underlying_type{std::move(other)},
         : underlying_type{std::move(other)},
           owner{other.owner},
           owner{other.owner},
           construction{std::move(other.construction)},
           construction{std::move(other.construction)},
@@ -137,7 +137,7 @@ public:
           update{std::move(other.update), allocator} {}
           update{std::move(other.update), allocator} {}
 
 
     /*! @brief Default destructor. */
     /*! @brief Default destructor. */
-    ~basic_sigh_mixin() noexcept override = default;
+    ~basic_sigh_mixin() noexcept(noexcept(std::declval<underlying_type>().~underlying_type())) override = default;
 
 
     /**
     /**
      * @brief Default copy assignment operator, deleted on purpose.
      * @brief Default copy assignment operator, deleted on purpose.
@@ -150,7 +150,7 @@ public:
      * @param other The instance to move from.
      * @param other The instance to move from.
      * @return This mixin.
      * @return This mixin.
      */
      */
-    basic_sigh_mixin &operator=(basic_sigh_mixin &&other) noexcept {
+    basic_sigh_mixin &operator=(basic_sigh_mixin &&other) noexcept(noexcept(std::declval<underlying_type>().operator=(std::move(other)))) {
         owner = other.owner;
         owner = other.owner;
         construction = std::move(other.construction);
         construction = std::move(other.construction);
         destruction = std::move(other.destruction);
         destruction = std::move(other.destruction);