diff options
| author | Felix Morgner <felix.morgner@ost.ch> | 2026-03-23 12:19:23 +0100 |
|---|---|---|
| committer | Felix Morgner <felix.morgner@ost.ch> | 2026-03-23 12:19:23 +0100 |
| commit | d31d12a612e9bbb1eb32ba7bcb17d70ff917ac9e (patch) | |
| tree | 8e4bd77dae7e9742bb710811053f62561bb1e352 /libs/kstd/include | |
| parent | a2a407efd453635af9ff6d3514114bfee95bcbb9 (diff) | |
| download | teachos-d31d12a612e9bbb1eb32ba7bcb17d70ff917ac9e.tar.xz teachos-d31d12a612e9bbb1eb32ba7bcb17d70ff917ac9e.zip | |
kstd/vector: expand tests
Diffstat (limited to 'libs/kstd/include')
| -rw-r--r-- | libs/kstd/include/kstd/vector | 7 |
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; |
