Boost logo

Boost :

Subject: Re: [boost] [conversion] try_lexical_cast and 200$
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2013-12-12 19:32:53


AMDG

On 12/12/2013 04:12 PM, Eric Niebler wrote:
> On 12/12/2013 9:35 AM, Matt Calabrese wrote:
>> A little hackish, but:
>>
>> http://codepaste.net/py5ot3
>
> template< class T, int = 0, class S >
> boost::optional<T> lexical_cast( S const&, std::nothrow_t );
>
> Is that even legal?!

I believe so. Since S can be deduced, it
doesn't have to be specified explicitly,
so it doesn't make the default for the
second argument useless.

> A non-defaulted template parameter after a
> defaulted one? <boggle> How will this fare on older compilers, I wonder.
>

Older compilers won't accept default template
parameters for function templates at all,
since it's a C++11 feature.

In Christ,
Steven Watanabe


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