aboutsummaryrefslogtreecommitdiff
path: root/libs/kstd
diff options
context:
space:
mode:
authorFelix Morgner <felix.morgner@ost.ch>2026-03-20 16:58:03 +0100
committerFelix Morgner <felix.morgner@ost.ch>2026-03-20 16:58:03 +0100
commit9433102e33dae5697ca71c1d9116791fa933c974 (patch)
tree21c581a83c02a65ca37cd9e9ddf5e9558abc7f1c /libs/kstd
parentcd6bff48ab828f0a1c5b6a1a36f8eec81f0eb81f (diff)
downloadteachos-9433102e33dae5697ca71c1d9116791fa933c974.tar.xz
teachos-9433102e33dae5697ca71c1d9116791fa933c974.zip
kstd/vector: add missing constexpr
Diffstat (limited to 'libs/kstd')
-rw-r--r--libs/kstd/include/kstd/vector8
1 files changed, 4 insertions, 4 deletions
diff --git a/libs/kstd/include/kstd/vector b/libs/kstd/include/kstd/vector
index d66c63b..2d148e4 100644
--- a/libs/kstd/include/kstd/vector
+++ b/libs/kstd/include/kstd/vector
@@ -384,7 +384,7 @@ namespace kstd
//! Get a reference to the first element of this vector.
//!
//! The behavior is undefined if this vector is empty.
- [[nodiscard]] auto front() const -> const_reference
+ [[nodiscard]] constexpr auto front() const -> const_reference
{
return *begin();
}
@@ -484,13 +484,13 @@ namespace kstd
}
//! Get a reverse iterator to the reverse end.
- [[nodiscard]] auto rend() const noexcept -> const_reverse_iterator
+ [[nodiscard]] constexpr auto rend() const noexcept -> const_reverse_iterator
{
return const_reverse_iterator{begin()};
}
//! Get a reverse iterator to the reverse end.
- [[nodiscard]] auto crend() const noexcept -> const_reverse_iterator
+ [[nodiscard]] constexpr auto crend() const noexcept -> const_reverse_iterator
{
return rend();
}
@@ -597,7 +597,7 @@ namespace kstd
//! Remove the last element of this vector.
//!
//! If this vector is empty, the behavior is undefined.
- auto pop_back() -> void
+ constexpr auto pop_back() -> void
{
--m_size;
std::allocator_traits<allocator_type>::destroy(m_allocator, data() + size());