aboutsummaryrefslogtreecommitdiff
path: root/libs/kstd/include
diff options
context:
space:
mode:
authorFelix Morgner <felix.morgner@ost.ch>2026-03-26 18:19:52 +0100
committerFelix Morgner <felix.morgner@ost.ch>2026-03-27 07:02:35 +0100
commit096d7505cfc2d60e58a6dd4d80fd7f3638c9bb94 (patch)
tree9af50bb4c8f0ed134fa6ab47c347140fcfa0ef8a /libs/kstd/include
parentf6100699cd93606147ebe94a777b6e4aff7c5f50 (diff)
downloadteachos-096d7505cfc2d60e58a6dd4d80fd7f3638c9bb94.tar.xz
teachos-096d7505cfc2d60e58a6dd4d80fd7f3638c9bb94.zip
kstd/vector: increase test coverage
Diffstat (limited to 'libs/kstd/include')
-rw-r--r--libs/kstd/include/kstd/vector7
1 files changed, 6 insertions, 1 deletions
diff --git a/libs/kstd/include/kstd/vector b/libs/kstd/include/kstd/vector
index 74aefa9..771fc87 100644
--- a/libs/kstd/include/kstd/vector
+++ b/libs/kstd/include/kstd/vector
@@ -548,7 +548,6 @@ namespace kstd
if (new_capacity > max_size())
{
kstd::os::panic("[kstd:vector] Tried to reserve more space than theoretically possible.");
- return;
}
auto new_data = allocate_n(new_capacity);
@@ -690,6 +689,12 @@ namespace kstd
return begin() + prefix_size;
}
+ //! Erase an element at a given position.
+ //!
+ //! @note This function will panic if position == end()
+ //!
+ //! @param position An interator pointing to the element to delete
+ //! @return An iterator pointing to the element after the deleted element
constexpr auto erase(const_iterator position) -> iterator
{
if (position == end())