Boost logo

Boost :

From: Howard Hinnant (hinnant_at_[hidden])
Date: 2001-10-06 10:44:54


On Saturday, October 6, 2001, at 11:18 AM, David Abrahams wrote:

> <shudder!>That would mean that standard headers would always have to
> include
> definitions for all types they use, because user-defined classes can
> also
> have implicit conversions. I don't think you really mean that, do you?

I believe I do. But perhaps your next example will convince me
otherwise.

> #inlcude <iosfwd>
> struct sstream_pimpl
> {
> sstream_pimpl();
> ~sstream_pimpl();
> operator std::basic_stringstream<char>&() const;
> std::basic_stringstream<char>* m_data;
> };
>
> void g(std::basic_stringstream<char> const&);
>
> void f()
> {
> sstream_pimpl x;
> g(x); // legal?
> x << 1; // legal?
> }

g(x); // Yes, legal. I see no reason to have the complete definition
of stringstream here.

x << 1; // No, not legal.

Error : illegal operand
HelloWorld.c line 24 x << 1; // legal?

-Howard


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