Boost logo

Boost :

From: Beman Dawes (bdawes_at_[hidden])
Date: 2001-10-04 14:32:11

At 03:06 PM 10/4/2001, Peter Dimov wrote:

>From: "Beman Dawes" <bdawes_at_[hidden]>
>> My reading of the rules is that if a standard library header requires a
>> definition of a type (presumably because it needs a complete type), the
>> appropriate standard library header has to be included by the
>> implementation. But if only a declaration is required (because the
>> is such an incomplete type is OK), the full header doesn't have to be
>> included.
>I think that the rules are even stricter than that. When a standard
>uses std::string (as a complete type), for example, this most probably
>means that std::string has been defined (although I don't think that even
>that is guaranteed. ;-) )
>However this doesn't mean that <string> has been included, or that the
>definitions of the templated std::string members are visible.

I'm basic my reading on the footnote for paragraph 1, which says
"C++ headers must include a C++ header that contains any needed definition

>Mostly academic, of course.

Yes. For users, the rule is simple: If you use a name from the standard
library, always include a standard library header documented as providing
that name. Never assume some other standard library header will include it
for you.


Boost list run by bdawes at, gregod at, cpdaniel at, john at