@@ -531,6 +531,7 @@ struct extensions_t : boost::multi::detail::tuple_prepend_t<index_extension, typ
531531 BOOST_MULTI_HD constexpr auto operator +(difference_type n) const {
532532 return iterator{*this } += n;
533533 }
534+ friend BOOST_MULTI_HD constexpr auto operator +(difference_type n, iterator const & self) -> iterator { return self + n; } // `n + it` form, required by std::random_access_iterator
534535
535536 BOOST_MULTI_HD constexpr auto operator ++() -> auto & {
536537 ++rest_it_;
@@ -540,6 +541,7 @@ struct extensions_t : boost::multi::detail::tuple_prepend_t<index_extension, typ
540541 }
541542 return *this ;
542543 }
544+ BOOST_MULTI_HD constexpr auto operator ++(int ) -> iterator { iterator ret{*this }; ++(*this ); return ret; } // NOLINT(cert-dcl21-cpp) required by std::weakly_incrementable
543545
544546 BOOST_MULTI_HD constexpr auto operator --() -> auto & {
545547 if ( rest_it_ == rest_begin_ ) {
@@ -549,6 +551,7 @@ struct extensions_t : boost::multi::detail::tuple_prepend_t<index_extension, typ
549551 --rest_it_;
550552 return *this ;
551553 }
554+ BOOST_MULTI_HD constexpr auto operator --(int ) -> iterator { iterator ret{*this }; --(*this ); return ret; } // NOLINT(cert-dcl21-cpp)
552555
553556 BOOST_MULTI_HD constexpr auto operator [](difference_type n) const { return *((*this ) + n); }
554557
@@ -557,6 +560,8 @@ struct extensions_t : boost::multi::detail::tuple_prepend_t<index_extension, typ
557560
558561 friend BOOST_MULTI_HD constexpr auto operator < (iterator const & self, iterator const & other) { return (self.curr_ < other.curr_ ) || ((self.curr_ == other.curr_ ) && (self.rest_it_ < other.rest_it_ )); }
559562 friend BOOST_MULTI_HD constexpr auto operator <=(iterator const & self, iterator const & other) { return (self < other) || (self == other); }
563+ friend BOOST_MULTI_HD constexpr auto operator > (iterator const & self, iterator const & other) { return other < self; } // for std::totally_ordered
564+ friend BOOST_MULTI_HD constexpr auto operator >=(iterator const & self, iterator const & other) { return !(self < other); }
560565 };
561566
562567 constexpr auto begin () const {
0 commit comments