libstdc++: Reduce header dependencies of <algorithm> in C++20 [PR 92546]
authorJonathan Wakely <jwakely@redhat.com>
Thu, 8 Apr 2021 09:01:08 +0000 (10:01 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Fri, 8 Oct 2021 14:00:06 +0000 (15:00 +0100)
The <bits/ranges_algobase.h> header doesn't need the stream and
streambuf iterators, so don't include the whole of <iterator>.

libstdc++-v3/ChangeLog:

PR libstdc++/92546
* include/bits/ranges_algobase.h: Replace <iterator> with a
subset of the headers it includes.

libstdc++-v3/include/bits/ranges_algobase.h

index cfbac83..c8c4d03 100644 (file)
@@ -33,7 +33,9 @@
 #if __cplusplus > 201703L
 
 #include <compare>
-#include <iterator>
+#include <bits/stl_iterator_base_types.h>
+#include <bits/stl_iterator_base_funcs.h>
+#include <bits/stl_iterator.h>
 #include <bits/ranges_base.h> // ranges::begin, ranges::range etc.
 #include <bits/invoke.h>      // __invoke
 #include <bits/cpp_type_traits.h> // __is_byte