[committed] libstdc++: Reduce header dependencies of <algorithm> in C++20 [PR 92546]

Message ID YWBO94Gm8KiVpoa1@redhat.com
State Committed
Commit a1fc4075fcdf028f2e1dc00ce515a947127e2667
Headers
Series [committed] libstdc++: Reduce header dependencies of <algorithm> in C++20 [PR 92546] |

Commit Message

Jonathan Wakely Oct. 8, 2021, 2 p.m. UTC
  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.

Tested powerpc64le-linux. Committed to trunk.
commit a1fc4075fcdf028f2e1dc00ce515a947127e2667
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Thu Apr 8 10:01:08 2021

    libstdc++: Reduce header dependencies of <algorithm> in C++20 [PR 92546]
    
    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.
  

Patch

diff --git a/libstdc++-v3/include/bits/ranges_algobase.h b/libstdc++-v3/include/bits/ranges_algobase.h
index cfbac839749..c8c4d032983 100644
--- a/libstdc++-v3/include/bits/ranges_algobase.h
+++ b/libstdc++-v3/include/bits/ranges_algobase.h
@@ -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