Boost logo

Boost :

From: David Abrahams (david.abrahams_at_[hidden])
Date: 2001-10-10 19:04:38

----- Original Message -----
From: "Howard Hinnant" <hinnant_at_[hidden]>

> On Wednesday, October 10, 2001, at 07:12 PM, David Abrahams wrote:
> Hmm... I'm not sure I'm completely following your thoughts. "Up and
> running" in the context I used it meant being able to stream the
> built-in type: string literal. And the analogy is that to do so you
> have to implicitly use methods defined from another class in another
> header, even though you don't explicitly mention the other class
> (basic_ostream). (just like needing the string constructor without
> mentioning std::string in the stdexcept example)

Okay, I see the analogy. Now that I see it <flameproof suit on>I am inclined
to think that you should have to #include <ostream> in order to get the code
to compile. After all, that header is where the inserter is defined.

> I don't believe your example above is legal because there is no
> operator << in scope that will take an ostringstream on the left and an
> X on the right.

Sounds like the same issue to me.

Now, about the issue of not being able to /construct/ a basic_ostringstream
without including <ostream>, my instincts lead me in the other direction.
Still in all, if you want to declare a function taking a
basic_ostringstream&, should you have to compile the definition of ostream?


  David Abrahams, C++ library designer for hire

        C++ Booster (
          email: david.abrahams_at_[hidden]

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