On Mon, 22 May 2023 at 21:51, François Dumont via Libstdc++ < libstdc++@gcc.gnu.org> wrote: > I was thinking that it might be nice to get rid of predefined_ops.h > content. > > So here is a start with __negate. Drawback is that stl_algo.h has to > include . We definitely don't want that. std::not_fn could be move to its own header. But I'm not sure this is a good change anyway, as we can't do it unconditionally. Pre-C++17 code would still be using the predefined_ops.h function objects, so we can't remove that code. And we'll get template bloat from instantiating the algos twice, once with the old function objects and once with std::not_fn. > For now I just get rid of stl_algo.h include in > to rather use stl_algobase.h. But maybe it would be better > to also isolate std::not_fn in a dedicated header file so that > stl_algo.h do not have to include all . > > libstdc++: Replace __gnu_cxx::__ops::__negate with std::not_fn > > Replace the internal __gnu_cxx::__ops::__negate function and > associated > __gnu_cxx::__ops::_Iter_negate by the C++17 std::not_fn. > > libstdc++-v3/ChangeLog: > > * include/bits/predefined_ops.h: Include . > No, please don't include anywhere. If you do that, it means now defines every feature test macro in the entire library, which makes it look like you can get smart pointers and ranges and constexpr math all from . > [__cpp_lib_not_fn](__gnu_cxx::__ops::_Iter_negate): Remove. > [__cpp_lib_not_fn](__gnu_cxx::__ops::__negate): Remove. > * include/bits/stl_algo.h: Include for C++17 > and later. > [__cpp_lib_not_fn](__find_if_not): Use std::not_fn. > (std::__search, std::search(_FwdIt1, _FwdIt1, _FwdIt2, > _FwdIt2, _BinPred)): Move... > * include/bits/stl_algobase.h: ...here. > * include/std/functional: Replace include by > . > > Tests still running. > > François > >