Subject: Re: [Boost-users] [format] Alternative syntax
From: Emre Turkay (emreturkay2_at_[hidden])
Date: 2009-07-30 02:46:32


Hi,

On Wed, Jul 29, 2009 at 12:33:33PM -0700, Steven Watanabe wrote:
> Why is this syntax better?
>
> In Christ,
> Steven Watanabe

format f1("%s, %s");
string s1 = (f1 % arg1 % arg2).str();

format2 f2("%s, %s");
string s2 = f2(arg1, arg2);

I don't claim it's better in general, the first case is better in places
where you need to bind the arguments one by one. And I think the second
case is easier to read and understand and therefore it is better in places
where you can bind all the arguments at once and need the formatted
string immediately.

Take care,

     emre