Boost logo

Boost Users :

Subject: Re: [Boost-users] [format] Reuse of the format object
From: Ryan Gallagher (ryan.gallagher_at_[hidden])
Date: 2011-04-11 12:20:08


Maxime van Noppen <maxime <at> altribe.org> writes:
> Oh well, I just rewrote the operator<< calls as function calls and it
> becomes clear:
>
> operator<<(
> operator<<(std::cout, fmt % "a" % "b" % "c"), // 1
> fmt % 1 % 2 % 3); // 2

I think you could just write:

std::cout << fmt % "a" % "b" % "c";
std::cout << fmt % 1 % 2 % 3;

When the str(format&) or operator<<(std::ostream&, format&) is applied it should
check and clear the format bindings. HTH,

-Ryan


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net