I think I still got no feedback about this cleanup proposal. Here is a new version. François On 15/06/2023 07:07, François Dumont wrote: > I think we all agree that __gnu_cxx::__ops needed to be reimplemented, > here it is. > > Note that I kept the usage of std::ref in , and . > >     libstdc++: Reimplement __gnu_cxx::__ops operators > >     Replace functors using iterators as input to adopt functors that >     are matching the same Standard expectations as the ones imposed on >     predicates used in predicates-aware algos. Doing so we need far less >     functors. It impose that iterators are dereference at algo level and >     not in the functors anymore. > >     libstdc++-v3/ChangeLog: > >             * include/std/functional (_Not_fn): Move to... >             * include/bits/predefined_ops.h: ...here, and expose a > version >             in pre-C++14 mode. >             (__not_fn): New, use latter. >             (_Iter_less_iter, _Iter_less_val, _Val_less_iter, > _Iter_equal_to_iter) >             (_Iter_equal_to_val, _Iter_comp_iter, _Iter_comp_val, > _Val_comp_iter) >             (_Iter_equals_val, _Iter_equals_iter, _Iter_pred, > _Iter_comp_val) >             (_Iter_comp_to_val, _Iter_comp_to_iter, _Iter_negate): > Remove. >             (__iter_less_iter, __iter_less_val, __iter_comp_val, > __val_less_iter) >             (__val_comp_iter, __iter_equal_to_iter, > __iter_equal_to_val, __iter_comp_iter) >             (__val_comp_iter, __iter_equals_val, __iter_comp_iter, > __pred_iter): Remove. >             (_Less, _Equal_to, _Equal_to_val, _Comp_val): New. >             (__less, __equal_to, __comp_val): New. >             * include/bits/stl_algo.h: Adapt all algos to use new > __gnu_cxx::__ops operators. >             When possible use std::move to pass predicates between > routines. >             * include/bits/stl_algobase.h: Likewise. >             * include/bits/stl_heap.h: Likewise. >             * include/std/deque: Cleanup usage of __gnu_cxx::__ops > operators. >             * include/std/string: Likewise. >             * include/std/vector: Likewise. > > Tested under Linux x86_64 normal and _GLIBCXX_DEBUG modes. > > Ok to commit ? > > François >