-
- Downloads
libstdc++: Simplify copy-pasted algorithms in <ranges>
The <ranges> header currently copies some simple algorithms from <bits/ranges_algo.h>, which was originally done in order to avoid a circular dependency with the header. This is no longer an issue since the latter header now includes <bits/ranges_util.h> instead of all of <ranges>. This means we could now just include <bits/ranges_algo.h> and remove the copied algorithms, but that'd increase the size of <ranges> by ~10%. And we can't use the corresponding STL-style algorithms here because they assume input iterators are copyable. So this patch instead simplifies these copied algorithms, removing their constraints and unused parameters, and keeps them around. In a subsequent patch we're going to copy (a simplified version of) ranges::find into <ranges> as well. libstdc++-v3/ChangeLog: * include/std/ranges (__detail::find_if): Simplify. (__detail::find_if_not): Likewise. (__detail::min): Remove. (__detail::mismatch): Simplify. (take_view::size): Use std::min instead of __detail::min.
Loading
Please register or sign in to comment