Boost logo

Boost :

From: Hubert HOLIN (Hubert.Holin_at_[hidden])
Date: 2001-05-23 17:31:41

Paris (U.E.), le 24/05/20011

--- In boost_at_y..., Daryle Walker <darylew_at_m...> wrote:


> The reason is given in the error messages, I'm trying to use a class that
> only has its name identified, and I need the full definition. The <iosfwd>
> header _only_ gives names, it never gives full definitions. So the real
> question isn't why my compiler choking, but why yours is letting you get
> away with it. My main guess is: between CWP 5.3 and 6.1, a class (template)
> in one of the standard headers you #include changed its I/O implementation
> to use string-based streams internally. This change necessitated #including
> <sstream>, which also #includes <istream> and <ostream>. So you are
> "benefiting" from indirect #includes.
> Don't depend on indirect #includes, always #include the header for the full
> definition (if needed). The reason is that indirect #includes are not
> portable. They can be different across compilers (I told someone else here
> writing a garbage collector about an indirect <cassert>.) or even versions
> of the same compiler (like us here). I think someone here thought that
> indirect #includes shouldn't be visible at all! In the future, Metrowerks
> could change the implementation again to remove <sstream>, or block indirect
> #includes, so why take the risk?
> --
> Daryle Walker
> Mac, Internet, and Video Game Junkie
> darylew AT mac DOT com

                I agree with the need not to rely on indirect includes. I
just fail to see how the problem you describe can actually come about.
The interest of only including iosfwd is the fact that it is the
minimal include possible for things to work. Your clain is that it is
actually to little, and that more is needed. I just can't decide if the
problem is caused by my platform or yours. At any rate this has to be
resolved, and I will abide by the final recomandations (IOW, I need
some enlightement here!).

                        Hubert Holin

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