aboutsummaryrefslogtreecommitdiff
path: root/libs/kstd/include
diff options
context:
space:
mode:
Diffstat (limited to 'libs/kstd/include')
-rw-r--r--libs/kstd/include/kstd/vector7
1 files changed, 5 insertions, 2 deletions
diff --git a/libs/kstd/include/kstd/vector b/libs/kstd/include/kstd/vector
index 1242489..5655854 100644
--- a/libs/kstd/include/kstd/vector
+++ b/libs/kstd/include/kstd/vector
@@ -60,6 +60,9 @@ namespace kstd
explicit constexpr vector(allocator_type const & allocator) noexcept(
std::is_nothrow_copy_constructible_v<allocator_type>)
: m_allocator{allocator}
+ , m_size{0}
+ , m_capacity{0}
+ , m_data{allocate_n(m_capacity)}
{}
//! Construct a new vector and fill it with the given number of default constructed elements.
@@ -237,7 +240,7 @@ namespace kstd
//! Replace the contents of this vector by the copying from the given source vector.
//!
//! @param other The source vector.
- constexpr auto operator=(vector const & other) -> vector<value_type> &
+ constexpr auto operator=(vector const & other) -> vector &
{
if (this == std::addressof(other))
{
@@ -285,7 +288,7 @@ namespace kstd
//! @param other The source vector.
constexpr auto operator=(vector && other) noexcept(
std::allocator_traits<allocator_type>::propagate_on_container_move_assignment::value ||
- std::allocator_traits<allocator_type>::is_always_equal::value) -> vector<value_type> &
+ std::allocator_traits<allocator_type>::is_always_equal::value) -> vector &
{
using std::swap;