From 80bc0a1e22576fbeabea7f685137256dadc343fd Mon Sep 17 00:00:00 2001 From: bill Date: Tue, 29 Nov 2022 10:15:37 +0800 Subject: [PATCH] modified: server/vector_type.hpp --- server/vector_type.hpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/server/vector_type.hpp b/server/vector_type.hpp index f817051..939af88 100644 --- a/server/vector_type.hpp +++ b/server/vector_type.hpp @@ -61,6 +61,7 @@ public: typedef std::conditional_t(), astring_view, _Ty> value_t; vector_type(const uint32_t& size) : size(size), capacity(size) { container = (_Ty*)malloc(size * sizeof(_Ty)); + // TODO: calloc for objects. } constexpr vector_type(std::initializer_list<_Ty> _l) { size = capacity = _l.size(); @@ -164,6 +165,7 @@ public: capacity = new_capacity; } } + void emplace_back(const _Ty& _val) { grow(); container[size++] = _val;