iterator: add less-equal operators for libstdc++-10 compatibility

This commit is contained in:
Danny Robson 2020-02-17 14:29:50 +11:00
parent 9750796e4e
commit 0d497738ce
2 changed files with 8 additions and 0 deletions

View File

@ -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&

View File

@ -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;