From d31d12a612e9bbb1eb32ba7bcb17d70ff917ac9e Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Mon, 23 Mar 2026 12:19:23 +0100 Subject: kstd/vector: expand tests --- libs/kstd/include/kstd/vector | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'libs/kstd/include') 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) : 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 & + 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::propagate_on_container_move_assignment::value || - std::allocator_traits::is_always_equal::value) -> vector & + std::allocator_traits::is_always_equal::value) -> vector & { using std::swap; -- cgit v1.2.3