瀏覽代碼

mixin: suppress warning due to constepxr expression

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

+ 6 - 2
src/entt/entity/mixin.hpp

@@ -55,8 +55,12 @@ class sigh_mixin final: public Type {
                 if constexpr(std::is_same_v<typename underlying_type::value_type, typename underlying_type::entity_type>) {
                     destruction.publish(reg, *it);
                 } else {
-                    if(const auto entt = *it; !underlying_type::traits_type::in_place_delete || entt != tombstone) {
-                        destruction.publish(reg, entt);
+                    if(underlying_type::traits_type::in_place_delete) {
+                        if(const auto entt = *it; entt != tombstone) {
+                            destruction.publish(reg, entt);
+                        }
+                    } else {
+                        destruction.publish(reg, *it);
                     }
                 }
             }