diff --git a/public/blah/containers/vector.h b/public/blah/containers/vector.h index 4af5e12..210a9fc 100644 --- a/public/blah/containers/vector.h +++ b/public/blah/containers/vector.h @@ -30,7 +30,7 @@ namespace Blah int size() const; int capacity() const; - void reserve(size_t new_capacity); + void reserve(int new_capacity); void resize(int new_count); T* expand(int amount = 1); @@ -157,7 +157,7 @@ namespace Blah } template - inline void Vector::reserve(size_t cap) + inline void Vector::reserve(int cap) { if (cap > m_capacity) { @@ -213,22 +213,18 @@ namespace Blah template inline void Vector::push_back(const T& item) { - reserve(m_count + 1); - new (m_buffer + m_count) T(item); - m_count++; + emplace_back(item); } template inline void Vector::push_back(T&& item) { - reserve(m_count + 1); - new (m_buffer + m_count) T(std::move(item)); - m_count++; + emplace_back(std::move(item)); } template template - inline void Vector::emplace_back(Args && ...args) + inline void Vector::emplace_back(Args&& ...args) { reserve(m_count + 1); new (m_buffer + m_count) T(std::forward(args)...);