Boost logo

Boost :

From: James Kanze (kanze_at_[hidden])
Date: 2002-01-27 12:31:56


"Stewart, Robert" <stewart_at_[hidden]> writes:

    [...]
|> It's a little easier to see the <<'s in the second statement than
|> the %'s in the first. Unfortunately, using "<<" introduces problems
|> interacting with streams,

Is this from experience, or simply speculation? I was worried about the
same thing in my format class, and hesitated for a long time (using
operator,()). In the end, I bit the bullet, and in practice, it has
never caused any problem. The one thing I did have to do at a customer
site was recognize ostream manipulators, and use them to terminate the
format, and shift back to outputting to the ostream. The rule sounds
horrible and unorthagonal, but works well in practice, where people
write things like:

    logfile << GB_Format( "..." ) << x << y << std::endl ;

(and want the flush).

|> and suggests that the insertion operators already defined for
|> various types would work with format, so it isn't a good choice.

And why don't the insertion oeprators already defined for various types
work with format? I would have thought that that would be one of the
essential requirements.

-- 
James Kanze                                mailto:kanze_at_[hidden]
Conseils en informatique orientée objet/
                    Beratung in objektorientierter Datenverarbeitung
Ziegelhüttenweg 17a, 60598 Frankfurt, Germany Tel. +49(0)179 2607481

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