diff options
author | Chris Robinson <[email protected]> | 2019-12-25 21:48:40 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2019-12-25 21:48:40 -0800 |
commit | 06b7c63cef00a9641e7e36d972fdc3c0c78ca4b8 (patch) | |
tree | 7c082d0f4c25c2040e3851f8c64b61a338b40d78 /common | |
parent | f153def94194050b331c7a2674959b9ea1d0008d (diff) |
Fix reverse iterators for spans
Diffstat (limited to 'common')
-rw-r--r-- | common/alspan.h | 16 |
1 files changed, 8 insertions, 8 deletions
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<size_t C> constexpr span<element_type,C> 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<size_t C> constexpr span<element_type,C> first() const |