Boost logo

Boost :

Subject: Re: [boost] [lexical_cast] A suggestion
From: Michael Fawcett (michael.fawcett_at_[hidden])
Date: 2009-02-07 02:01:02


On Fri, Feb 6, 2009 at 11:02 PM, Vladimir Batov <batov_at_[hidden]> wrote:
>>> int i = lexical_cast<optional<int> >(mystring).get_value_or(-1);
>>>
>>> Why is this so bad?
>>
>> Well, if you want lexical_cast (and Boost) *not* used in the wide, then keep
>> mounting these wonderful complexities and interfaces. Surely the users will
>> be very supportive of your effort.
>
> Well, that was somewhat terse and unfriendly. Apologies. I'll elaborate and give you metrics.
>
> 1. int i = lexical_cast<optional<int> >(mystring).get_value_or(-1);

Please, no.

> 2. int i = lexical_cast(mystring, -1);

Again, +1 from me. I have the exact same use case, and the same
desire as Vladimir.

--Michael Fawcett


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