瀏覽代碼

any: debug-only check to detect nasty bugs in the client code, if any

Michele Caini 3 年之前
父節點
當前提交
26f85050c1
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. 2 0
      src/entt/core/any.hpp

+ 2 - 0
src/entt/core/any.hpp

@@ -351,6 +351,8 @@ public:
             vtable(operation::destroy, *this, nullptr);
             vtable(operation::destroy, *this, nullptr);
         }
         }
 
 
+        // unnecessary but it helps to detect nasty bugs
+        ENTT_ASSERT(!(instance = nullptr), "");
         info = &type_id<void>();
         info = &type_id<void>();
         vtable = nullptr;
         vtable = nullptr;
         mode = policy::owner;
         mode = policy::owner;