Просмотр исходного кода

any: try to make all compilers happy again

skypjack 5 месяцев назад
Родитель
Сommit
96b56ca630
1 измененных файлов с 6 добавлено и 1 удалено
  1. 6 1
      src/entt/core/any.hpp

+ 6 - 1
src/entt/core/any.hpp

@@ -268,7 +268,12 @@ public:
     basic_any &operator=(const basic_any &other) {
     basic_any &operator=(const basic_any &other) {
         if(this != &other) {
         if(this != &other) {
             destroy_if_owner();
             destroy_if_owner();
-            other.vtable ? other.vtable(request::copy, other, this) : initialize<void>();
+
+            if(other) {
+                other.vtable(request::copy, other, this);
+            } else {
+                initialize<void>();
+            }
         }
         }
 
 
         return *this;
         return *this;