[PATCH] Avoid unnecessary inclusion of <stdexcept> header
Jonathan Wakely
jwakely@redhat.com
Mon Jun 17 08:21:00 GMT 2019
On 06/06/19 16:38 +0100, Jonathan Wakely wrote:
>This can greatly reduce the amount of preprocessed code that is included
>by other headers, because <stdexcept> depends on <string> which is huge.
>
> * include/std/array: Do not include <stdexcept>.
> * include/std/optional: Include <exception> and
> <bits/exception_defines.h> instead of <stdexcept>.
>
>Preprocessed line counts for C++17 mode:
>
> <tuple> <memory> <map>
>Before 25774 32453 31616
>After 9925 23194 19062
>
>Tested x86_64-linux, committed to trunk.
>
>Once we have a gcc-10/porting_to.html page I'll note this change
>there, because code relying on std::string and std::allocator being
>defined by transitive includes will need to include the right headers.
After this change some tests fail without PCH, because they weren't
including what they use.
Tested x86_64-linux, committed to trunk.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.txt
Type: text/x-patch
Size: 5914 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20190617/82593610/attachment.bin>
More information about the Libstdc++
mailing list