Boost logo

Boost :

Subject: Re: [boost] [conversion] try_lexical_cast and 200$
From: Krzysztof Czainski (1czajnik_at_[hidden])
Date: 2013-12-12 04:08:19


2013/12/11 Antony Polukhin <antoshkka_at_[hidden]>

> There is a bounty for implementing a `try_lexical_cast` from Facebook:
> https://www.bountysource.com/issues/1352296-exceptionless-lexical_cast
>
> Because of that three questions arise:
>
> * Is there some official policy for "feature implementation sponsorship"?
>
> * `try_lexical_cast` must be added or not? And if yes, what signature is
> preffered:
>
> bool try_lexical_cast<Out, In>(Out&, const In&)
> bool try_lexical_cast<Out, In>(const In&, Out&)
> boost::optional<Out> try_lexical_cast<Out, In>(const In&)
>

How about:
boost::optional<Out> lexical_cast<Out, In>(const In&, std::nothrow_t)

Whether this or try_lexical_cast, I prefer the function to return an
optional.

Regards,
Kris


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