Boost logo

Boost Users :

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


Maxime van Noppen <maxime <at> altribe.org> writes:
>
> On 04/11/2011 06:20 PM, Ryan Gallagher wrote:
> > 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,
>
> Of course, and it works, but I don't like to be bitten without knowing
> what happened exactly. :) It might also be worth mentioning in the doc.
>

Yeah, was bitten by this too a long time back and had to look it up in the
docs to understand. Does this help explain?
http://www.boost.org/doc/libs/1_46_0/libs/format/doc/format.html#how_it_works

But, yeah, perhaps they should have a "don't do this" example with
explanation in that section.


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