Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2001-10-11 06:13:13


From: "Howard Hinnant" <hinnant_at_[hidden]>
> On Wednesday, October 10, 2001, at 05:06 PM, Peter Dimov wrote:
>
> > Is std::ostringstream after <sstream> a complete type? I hope that
> > you'll
> > say 'yes' because the other way lies madness.
> >
> > Can a complete type have incomplete bases?
>
> My point is that the following will compile on most compilers:
>
> template <class charT, class traits> class basic_ostream;
>
> template <class charT, class traits, class Allocator>
> class basic_ostringstream
> : public basic_ostream<charT, traits>
> {
> };

Yes, I understand...

> But you must fill out basic_ostream before you instantiate a
> basic_ostringstream. Hopefully the job of filling out basic_ostream
> will be done for you when you #include <sstream>. Otherwise you might
> have to #include <ostream> yourself.

... and I'm trying to say that such a definition in <sstream> does not
conform. After <sstream>, I should be able to instantiate a
basic_ostringstream (this is the whole point of <sstream>, isn't it); this
definition does not let me do that.

If you insist on this being legal, let me go further and ask: why do you
think that including <ostream> will help? After all it's legal - by the same
logic - for <ostream> to provide a "definition" of basic_ostream that cannot
be instantiated.

Let's go back to the original question: is std::ostringstream a complete
type after <sstream> has been included?

--
Peter Dimov
Multi Media Ltd.

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk