From 97d0b17b8edcb2615d4bbc31e3eefa18df5f8aa2 Mon Sep 17 00:00:00 2001 From: blueloveTH Date: Fri, 7 Apr 2023 11:16:08 +0800 Subject: [PATCH] Update vector.h --- src/vector.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/vector.h b/src/vector.h index c921dc17..d5ed28f6 100644 --- a/src/vector.h +++ b/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) {