diff options
author | Sam Atkins <atkinssj@serenityos.org> | 2022-04-06 12:05:26 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-04-06 14:31:52 +0200 |
commit | c0ca6e470f27dfd7429b79f1015462a834c19408 (patch) | |
tree | eafeed72bff085f8f00f48205bde594c65e74214 /AK | |
parent | 359365a06ae6fe9948ca2bb089688ae203690007 (diff) | |
download | serenity-c0ca6e470f27dfd7429b79f1015462a834c19408.zip |
AK+Userland: Rename Array::front/back to first/last
This is the name that is used for every other collection type so let's
be consistent.
Diffstat (limited to 'AK')
-rw-r--r-- | AK/Array.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/AK/Array.h b/AK/Array.h index d87cb1b9df..d4aa6791b8 100644 --- a/AK/Array.h +++ b/AK/Array.h @@ -34,11 +34,11 @@ struct Array { return __data[index]; } - [[nodiscard]] constexpr T const& front() const { return at(0); } - [[nodiscard]] constexpr T& front() { return at(0); } + [[nodiscard]] constexpr T const& first() const { return at(0); } + [[nodiscard]] constexpr T& first() { return at(0); } - [[nodiscard]] constexpr T const& back() const requires(Size > 0) { return at(Size - 1); } - [[nodiscard]] constexpr T& back() requires(Size > 0) { return at(Size - 1); } + [[nodiscard]] constexpr T const& last() const requires(Size > 0) { return at(Size - 1); } + [[nodiscard]] constexpr T& last() requires(Size > 0) { return at(Size - 1); } [[nodiscard]] constexpr bool is_empty() const { return size() == 0; } |