Explorar o código

Update vector.h

blueloveTH %!s(int64=3) %!d(string=hai) anos
pai
achega
97d0b17b8e
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  1. 2 1
      src/vector.h

+ 2 - 1
src/vector.h

@@ -16,9 +16,10 @@ struct small_vector{
         _data = _buffer;
     }
 
-    small_vector(int size): _size(size), _capacity(N){
+    small_vector(int size): _size(0), _capacity(N){
         _data = _buffer;
         reserve(size);
+        _size = size;
     }
 
     small_vector(const small_vector& other): _size(other._size), _capacity(other._capacity) {