@@ -27,6 +27,7 @@ using concepts::FoldFunctor;
2727using concepts::ForEachFunctor;
2828using concepts::Indexable;
2929using concepts::InspectFunctor;
30+ using concepts::NeFunctor;
3031using concepts::PositionFunctor;
3132using concepts::Summable;
3233using concepts::TryFoldFunctor;
@@ -123,6 +124,14 @@ class IterInterface
123124 [[nodiscard]] auto min () -> std::optional<R>;
124125
125126 [[nodiscard]] auto movingWindow (size_t size) -> MovingWindow<T, Derived>;
127+
128+ template <class Other >
129+ [[nodiscard]] auto ne (Other&& it) -> bool;
130+
131+ template <class Other , class Functor >
132+ requires NeFunctor<T, Functor>
133+ [[nodiscard]] auto neBy (Other&& it, Functor&& f) -> bool;
134+
126135 [[nodiscard]] auto nth (size_t element) -> std::optional<T>;
127136
128137 template <class Functor >
@@ -355,6 +364,22 @@ auto rusty_iterators::interface::IterInterface<T, Derived>::movingWindow(size_t
355364 return MovingWindow<T, Derived>{std::forward<Derived>(self ()), size};
356365}
357366
367+ template <class T , class Derived >
368+ template <class Other >
369+ auto rusty_iterators::interface::IterInterface<T, Derived>::ne(Other&& it) -> bool
370+ {
371+ return self ().neBy (std::forward<Other>(it),
372+ [](auto x) { return std::get<0 >(x) != std::get<1 >(x); });
373+ }
374+
375+ template <class T , class Derived >
376+ template <class Other , class Functor >
377+ requires rusty_iterators::concepts::NeFunctor<T, Functor>
378+ auto rusty_iterators::interface::IterInterface<T, Derived>::neBy(Other&& it, Functor&& f) -> bool
379+ {
380+ return self ().zip (std::forward<Other>(it)).any (std::forward<Functor>(f));
381+ }
382+
358383template <class T , class Derived >
359384auto rusty_iterators::interface::IterInterface<T, Derived>::nth(size_t element) -> std::optional<T>
360385{
0 commit comments