Boost logo

Boost :

Subject: Re: [boost] [convert] Now with Boost.Parameter interface.
From: David Abrahams (dave_at_[hidden])
Date: 2009-06-30 20:53:41


on Mon Jun 29 2009, "Stewart, Robert" <Robert.Stewart-AT-sig.com> wrote:

>> 3. I only managed to figure out how to supply only one
>> Boost.Parameter at a time like
>>
>> int i = convert<int>::from(str, 0)(locale_ = new_locale)(throw_ = true);
>>
>> I understand how to achieve
>>
>> int i = convert<int>::from(str, 0)((locale_ = new_locale, throw_ = true));
>>
>> (with double quotes) but do not want to go there as it looks somewhat
>> unorthodox. I cannot figure out how to achieve the following
>
> The doubled parentheses are, indeed, rare outside Boost.Preprocessor type code.
>
>> int i = convert<int>::from(str, 0)(locale_ = new_locale, throw_ = true);
>
> That is certainly preferable syntax.

It's not hard to achieve, but I don't think you'd like the effect:

   convert<int>::from(str, 0)

would have to return a function object rather than an int. What's wrong
with

  int i = convert<int>::from(str, 0, locale_ = new_locale, throw_ = true);

?

-- 
Dave Abrahams
BoostPro Computing
http://www.boostpro.com

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