[Bug libstdc++/99958] The <algorithm> seems to contain the entire <vector> and <string> in C++20 mode

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Apr 7 19:45:47 GMT 2021


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99958

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
                 CC|                            |rodgertq at gcc dot gnu.org
   Last reconfirmed|                            |2021-04-07
             Status|UNCONFIRMED                 |NEW

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
<string> is included by <bits/locale_classes.h> which is included by
<bits/ios_base.h> which is included by <streambuf> which is included by
<bits/streambuf_iterator.h> which is included by <iterator> which is included
by <bits/ranges_algobase.h>. I think that is unavoidable.

<vector> is included by <functional>, which is included by
<bits/glue_algorithm_defs.h>. That should not be including the whole of
<functional>. It looks like it only needs <bits/stl_pair.h>.

This is not a bug, but it's a compile-time pessimization to include huge
headers that we don't need.


More information about the Gcc-bugs mailing list