Date: 2001-10-04 14:35:51
--- In boost_at_y..., Beman Dawes <bdawes_at_a...> wrote:
> At 03:06 PM 10/4/2001, Peter Dimov wrote:
> >From: "Beman Dawes" <bdawes_at_a...>
> >> My reading of the rules is that if a standard library header
> >> definition of a type (presumably because it needs a complete
> >> appropriate standard library header has to be included by the
> >> implementation. But if only a declaration is required (because
> >> is such an incomplete type is OK), the full header doesn't have
> >> included.
> >I think that the rules are even stricter than that. When a
> >uses std::string (as a complete type), for example, this most
> >means that std::string has been defined (although I don't think
> >that is guaranteed. ;-) )
> >However this doesn't mean that <string> has been included, or
> >definitions of the templated std::string members are visible.
> I'm basic my reading on the footnote for 188.8.131.52 paragraph 1,
> "C++ headers must include a C++ header that contains any needed
> >Mostly academic, of course.
> Yes. For users, the rule is simple: If you use a name from the
> library, always include a standard library header documented as
> that name. Never assume some other standard library header will
> for you.
There's the rub, though. I never used "a name from the standard
library" for which I did not "include a standard library header
documented as providing that name". The issue actually stems from
calling the constructors with const char* parameters which need to be
implicitly cast to the const std::string& type. So I guess you could
turn this around and claim that the standard has a defect in design,
but I don't care to go that far. I honestly think this is a QoI
issue with STLPort.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk