using PCH branch to make precompiled std include

Paolo Carlini pcarlini@unitus.it
Mon Dec 16 15:32:00 GMT 2002


Nathan Myers wrote:

>Let me guess wildly at what's happening here.  The basic_string<> 
>constructor and destructor refer to std::allocator, which hasn't 
>explicitly been included here.  It may be that either the PCH 
>apparatus needs to be smarter about revealing definitions needed 
>(transitively) by other standard headers, or we need to be more 
>thorough about explicitly sub-including in standard headers the other
>headers it takes to use one.
>
Thanks for your feedback. This is how the installed <string> begins:

#ifndef _CPP_STRING
#define _CPP_STRING    1

#pragma GCC system_header

#include <bits/c++config.h>
#include <bits/stringfwd.h>
#include <bits/char_traits.h>
#include <memory>     // For allocator.

So...

Also, as expected, nothing changes if <memory> is added to header.h...

Paolo.




More information about the Libstdc++ mailing list