From 1aae1e5b7d8ee26c626c126fa64392a5ef949f42 Mon Sep 17 00:00:00 2001 From: guyingzhao Date: Sun, 6 Apr 2025 12:37:05 +0200 Subject: C++: Add f/Front() and b/Back() to Array to access first/last element --- src/Array.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'src/Array.cpp') diff --git a/src/Array.cpp b/src/Array.cpp index de1259e..49b8924 100644 --- a/src/Array.cpp +++ b/src/Array.cpp @@ -90,6 +90,26 @@ Node* Array::operator[](unsigned int array_index) return _array.at(array_index); } +Node* Array::Back() +{ + return _array.back(); +} + +Node* Array::back() +{ + return _array.back(); +} + +Node* Array::Front() +{ + return _array.front(); +} + +Node* Array::front() +{ + return _array.front(); +} + Array::iterator Array::Begin() { return _array.begin(); -- cgit v1.1-32-gdbae