[cfe-dev] [libcxx] Which headers must include other headers?

Craig, Ben via cfe-dev cfe-dev at lists.llvm.org
Wed Mar 9 14:20:20 PST 2016

 From the C++14 spec... Headers [res.on.headers]
    1 A C++ header may include other C++ headers. A C++ header shall
    provide the declarations and definitions
    that appear in its synopsis. A C++ header shown in its synopsis as
    including other C++ headers shall provide
    the declarations and definitions that appear in the synopses of
    those other headers.

I'm not 100% sure I know what this means.  If a header (say... 
<system_error>) mentions a class (like std::string), is it required to 
provide the full definition for std::string, or is the forward declared 
template good enough?  Right now, libcxx uses the forward declaration.  
What about entities that have specializations scattered all over the 
place, like std::hash?  Is the unspecialized forward declaration good 
enough, or does the full bulk of all the std::hash specializations have 
to come along too?

Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20160309/cb87f925/attachment.html>

More information about the cfe-dev mailing list