فهرست منبع

AK: Vector::resize() should initialize new slots for primitive types

We call placement new for the newly added slots. However, we should
also specify an initializer so primitive data types like u64 are
initialized appropriately.
Gunnar Beutner 4 سال پیش
والد
کامیت
a11a1cd4d6
1فایلهای تغییر یافته به همراه1 افزوده شده و 1 حذف شده
  1. 1 1
      AK/Vector.h

+ 1 - 1
AK/Vector.h

@@ -619,7 +619,7 @@ public:
             return false;
 
         for (size_t i = size(); i < new_size; ++i)
-            new (slot(i)) T;
+            new (slot(i)) T {};
         m_size = new_size;
         return true;
     }