From 35b776540f2750ad4537bd42cb473ce7544b40ea Mon Sep 17 00:00:00 2001 From: piegames Date: Tue, 3 Mar 2026 11:40:04 +0100 Subject: [PATCH] libutil/LinearMap: Expose rbegin and rend functions Change-Id: I9a4350cc147c98c785b26fbef6c235cd5c48a4cc --- lix/libutil/linear-map.hh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lix/libutil/linear-map.hh b/lix/libutil/linear-map.hh index 8e9318fd0..13e43e9c3 100644 --- a/lix/libutil/linear-map.hh +++ b/lix/libutil/linear-map.hh @@ -39,13 +39,13 @@ private: } public: - using typename base::const_iterator, typename base::value_type; + using typename base::const_iterator, typename base::const_reverse_iterator, typename base::value_type; LinearMap() = default; LinearMap(size_t expectedSize) { reserve(expectedSize); } - using base::size, base::reserve, base::clear, base::cbegin, base::cend; + using base::size, base::reserve, base::clear, base::cbegin, base::cend, base::crbegin, base::crend; /* Insert an element at the correct position, shifting later elements back by * one place. Returns `true` if a previous element with that key was @@ -148,5 +148,13 @@ public: { return cend(); } + const_reverse_iterator rbegin() const + { + return crbegin(); + } + const_reverse_iterator rend() const + { + return crend(); + } }; } // namespace nix