浏览代码

storage: explicit checks

Michele Caini 1 年之前
父节点
当前提交
a348ff7dd1
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/entt/entity/storage.hpp

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

@@ -374,7 +374,7 @@ protected:
      * @return Iterator pointing to the emplaced element.
      * @return Iterator pointing to the emplaced element.
      */
      */
     underlying_iterator try_emplace([[maybe_unused]] const Entity entt, [[maybe_unused]] const bool force_back, const void *value) override {
     underlying_iterator try_emplace([[maybe_unused]] const Entity entt, [[maybe_unused]] const bool force_back, const void *value) override {
-        if(value) {
+        if(value != nullptr) {
             if constexpr(std::is_copy_constructible_v<element_type>) {
             if constexpr(std::is_copy_constructible_v<element_type>) {
                 return emplace_element(entt, force_back, *static_cast<const element_type *>(value));
                 return emplace_element(entt, force_back, *static_cast<const element_type *>(value));
             } else {
             } else {