Boost logo

Boost :

Subject: Re: [boost] [review] Convert library
From: Roland Bock (rbock_at_[hidden])
Date: 2014-05-26 08:47:13


On 2014-05-26 14:37, Vladimir Batov wrote:
> Roland Bock-2 wrote
>> Using one of the many suggestions for the syntax, please change to what
>> you end up with:
>>
>> int t = boost::convert
>> <int>
>> ::from("17", []{
>> log("could not read noOfThreads");
>> throw ConfigError(); });
>>
>> int c = boost::convert
>> <int>
>> ::from("17", []{
>> log("could not read noOfCores, using default");
>> return 7; });
> That looks cool. We might provide a bunch of callables to cover
> throwable/non-throwable/default-returning/etc. behavior, right?
Right :-)
> How about
> non-throwing failure detection? What should be the signature for that
> behavioral callable? optional<T> op()()?
>
Personally, I would not use that (preferring either default or
exception), but yes, I guess so.

Regards,

Roland


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