From 06b7c63cef00a9641e7e36d972fdc3c0c78ca4b8 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Wed, 25 Dec 2019 21:48:40 -0800 Subject: Fix reverse iterators for spans --- common/alspan.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'common/alspan.h') diff --git a/common/alspan.h b/common/alspan.h index cb34d410..046b7d76 100644 --- a/common/alspan.h +++ b/common/alspan.h @@ -137,10 +137,10 @@ public: constexpr const_iterator cbegin() const noexcept { return mData; } constexpr const_iterator cend() const noexcept { return mData+E; } - constexpr reverse_iterator rbegin() const noexcept { return end(); } - constexpr reverse_iterator rend() const noexcept { return begin(); } - constexpr const_reverse_iterator crbegin() const noexcept { return cend(); } - constexpr const_reverse_iterator crend() const noexcept { return cbegin(); } + constexpr reverse_iterator rbegin() const noexcept { return reverse_iterator{end()}; } + constexpr reverse_iterator rend() const noexcept { return reverse_iterator{begin()}; } + constexpr const_reverse_iterator crbegin() const noexcept { return const_reverse_iterator{cend()}; } + constexpr const_reverse_iterator crend() const noexcept { return const_reverse_iterator{cbegin()}; } template constexpr span first() const @@ -232,10 +232,10 @@ public: constexpr const_iterator cbegin() const noexcept { return mData; } constexpr const_iterator cend() const noexcept { return mDataEnd; } - constexpr reverse_iterator rbegin() const noexcept { return end(); } - constexpr reverse_iterator rend() const noexcept { return begin(); } - constexpr const_reverse_iterator crbegin() const noexcept { return cend(); } - constexpr const_reverse_iterator crend() const noexcept { return cbegin(); } + constexpr reverse_iterator rbegin() const noexcept { return reverse_iterator{end()}; } + constexpr reverse_iterator rend() const noexcept { return reverse_iterator{begin()}; } + constexpr const_reverse_iterator crbegin() const noexcept { return const_reverse_iterator{cend()}; } + constexpr const_reverse_iterator crend() const noexcept { return const_reverse_iterator{cbegin()}; } template constexpr span first() const -- cgit v1.2.3