Reduce header dependencies in <iterator>

Message ID 20190514124738.GA17644@redhat.com
State New
Headers show
Series
  • Reduce header dependencies in <iterator>
Related show

Commit Message

Jonathan Wakely May 14, 2019, 12:47 p.m.
* include/std/iterator: Include <iosfwd> instead of <istream> and
	<ostream>.

This makes <iterator> 5kloc smaller!

Tested powerpc64le-linux, committed to trunk.
commit 32a8a4b2518030b683561d26ef64c301b46deb5a
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Thu Feb 23 20:13:37 2017 +0000

    Reduce header dependencies in <iterator>
    
            * include/std/iterator: Include <iosfwd> instead of <istream> and
            <ostream>.

Patch

diff --git a/libstdc++-v3/include/std/iterator b/libstdc++-v3/include/std/iterator
index 9d9e19c4c6b..28e7c65a9e5 100644
--- a/libstdc++-v3/include/std/iterator
+++ b/libstdc++-v3/include/std/iterator
@@ -61,8 +61,7 @@ 
 #include <bits/stl_iterator_base_types.h>
 #include <bits/stl_iterator_base_funcs.h>
 #include <bits/stl_iterator.h>
-#include <ostream>
-#include <istream>
+#include <iosfwd>
 #include <bits/stream_iterator.h>
 #include <bits/streambuf_iterator.h>
 #include <bits/range_access.h>