David Abrahams | 2 Jul 2009 02:13
Picon
Picon
Favicon
Gravatar

Re: [convert] Now with Boost.Parameter interface.


on Wed Jul 01 2009, "Vladimir Batov" <batov-AT-people.net.au> wrote:

> From: "David Abrahams" <dave <at> boostpro.com>
>> ...  What's wrong with
>>
>>  int i = convert<int>::from(str, 0, locale_ = new_locale, throw_ = true);
>
> I personally to not feel there is anything wrong per se with the above. The reason I
> did not pursue it was that it introduces a limit on the number of the parameters and I
> did not see it offering any major advantages to balance that shortcoming over the
> supported
>
> int i = convert<int>::from(str, 0)(locale_ = new_locale)(throw_ = true);
>
> On the other hand the supported interface seems to scale considerably better and is no
> longer to type:
>
> int i = convert<int>::from(str, 0)(locale_ = new_locale)(throw_ = true);
> int i = convert<int>::from(str, 0, locale_ = new_locale, throw_ = true);

But again, it has the downside that none of your calls above can return
an actual int.  That can have unexpected effects, e.g. in

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

when the deduced template argument is actually your proxy type.

--

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

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost


Gmane