diff --git a/AK/Span.h b/AK/Span.h index 383d2ae434b58903637ac055d62e7c7bcdf08f9c..79798c1527526f397f540a85d5969df922368272 100644 --- a/AK/Span.h +++ b/AK/Span.h @@ -212,6 +212,16 @@ public: return this->m_values[index]; } + [[nodiscard]] ALWAYS_INLINE constexpr T const& first() const + { + return this->at(0); + } + + [[nodiscard]] ALWAYS_INLINE constexpr T& first() + { + return this->at(0); + } + [[nodiscard]] ALWAYS_INLINE constexpr T const& last() const { return this->at(this->size() - 1);