diff --git a/AK/Span.h b/AK/Span.h index a39c3757a7..6816797cf7 100644 --- a/AK/Span.h +++ b/AK/Span.h @@ -276,6 +276,12 @@ public: return at(index); } + void reverse() + { + for (size_t i = 0; i < size() / 2; ++i) + AK::swap(at(i), at(size() - i - 1)); + } + [[nodiscard]] ALWAYS_INLINE constexpr T& operator[](size_t index) { return at(index);