From 0d497738cea3ed564ba0353d950368031c65bdb0 Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Mon, 17 Feb 2020 14:29:50 +1100 Subject: [PATCH] iterator: add less-equal operators for libstdc++-10 compatibility --- iterator/dereference.hpp | 7 +++++++ iterator/iota.hpp | 1 + 2 files changed, 8 insertions(+) diff --git a/iterator/dereference.hpp b/iterator/dereference.hpp index 7192939c..daf73953 100644 --- a/iterator/dereference.hpp +++ b/iterator/dereference.hpp @@ -52,6 +52,13 @@ namespace cruft::iterator { } + decltype(auto) + operator<= (dereference_adapter const &rhs) const + { + return m_cursor <= rhs.m_cursor; + } + + //--------------------------------------------------------------------- // Iterator movement operations dereference_adapter& diff --git a/iterator/iota.hpp b/iterator/iota.hpp index 5674ccea..dad86f0c 100644 --- a/iterator/iota.hpp +++ b/iterator/iota.hpp @@ -60,6 +60,7 @@ namespace cruft::iterator { constexpr bool operator!= (iterator const &rhs) const noexcept { return m_value != rhs.m_value; } constexpr bool operator== (iterator const &rhs) const noexcept { return m_value == rhs.m_value; } + constexpr bool operator<= (iterator const &rhs) const noexcept { return m_value <= rhs.m_value; } private: ValueT m_value;