Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2001-10-04 12:08:56

From: <williamkempf_at_[hidden]>
> > Looks like basic_string is only fwd declared at his point.
> I'm not sure if STLPort is compliant here or not, but this causes
> grief. The standard explicitly says that the std::exception types
> should all take an argument of type "const string&" in their
> constructors. The fact that the type is a reference may allow
> implementations to only forward declare std::string here, but doing
> so is a questionable practice as it doesn't accomplish much of
> anything. Any code that constructs a std::exception type is going to
> have to include <string> any way, so very few compilation units will
> benefit from the "optimization". It won't hurt for me to include
> <string> in <boost/thread/exceptions>, but I really question why I
> should have to.

Because the standard says so. If you use std::string, you have to #include
<string>. Other headers are not required to do it for you, even when their
interfaces mention std::string.

Peter Dimov
Multi Media Ltd.

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