From 64e699a2d22190ac048106e4b950df3883152b4b Mon Sep 17 00:00:00 2001 From: q66 Date: Sat, 11 Mar 2017 14:24:41 +0100 Subject: [PATCH] implement more compares to make range halves conformant random/bidirectional iterators --- ostd/range.hh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/ostd/range.hh b/ostd/range.hh index 43d9f43..ba36fa9 100644 --- a/ostd/range.hh +++ b/ostd/range.hh @@ -423,6 +423,18 @@ public: bool operator!=(range_half const &half) const { return !equals(half); } + bool operator<(range_half const &half) const { + return distance(half) > 0; + } + bool operator>(range_half const &half) const { + return distance(half) < 0; + } + bool operator<=(range_half const &half) const { + return distance(half) >= 0; + } + bool operator>=(range_half const &half) const { + return distance(half) <= 0; + } /* iterator like interface */