|
|
On 8/2/2011 11:03, Warp wrote:
> std::cout<< boost::format("writing %1%, x=%2% : %3%-th try")
> % "toto" % 40.23 % 50;
>
> (OTOH I'm guessing this is less efficient than the direct approach.)
I'm guessing boost::format has to return something that overloads % in the
same way that cout overloads <<. I'm not sure from your example whether it
supports the flexible formatting stuff either, which was more my point in
the example.
>> printf("Here are " MySpecialIntFmt " integers", i);
>
> Which is inconvenient if you need to use some format specifiers (such
> as printing at least 5 digits, with leading zeros).
Yeah. I never needed to, but I suppose you could use just "i" instead of
"%i". In any case, it's clearly not flexible enough to handle things the way
you'd like.
--
Darren New, San Diego CA, USA (PST)
How come I never get only one kudo?
Post a reply to this message
|
|