Subject: Re: [boost] New, powerful way to use enable_if in C++0x
From: Jeremiah Willcock (jewillco_at_[hidden])
Date: 2011-04-11 21:57:04
On Mon, 11 Apr 2011, Beman Dawes wrote:
> On Mon, Apr 11, 2011 at 5:38 PM, Steven Watanabe <watanabesj_at_[hidden]> wrote:
>> On 04/11/2011 11:40 AM, Jeffrey Lee Hellrung, Jr. wrote:
>>> On Mon, Apr 11, 2011 at 11:15 AM, Matt Calabrese<rivorus_at_[hidden]>
>>>> However, in C++0x, there is a new way to use enable_if by altering
>>>> the function parameter list nor the specification of the return type. It
>>>> be used with operators, constructors, variadic function templates, and
>>>> overloaded conversion operations (the latter of which was previously
>>>> considered impossible). The way to do it is with C++0x default function
>>>> template parameters.
>>>> <snip> Should such use be added to the docs as supported behavior in 0x
>>> I think the case for conversion operators alone is compelling enough to
>>> warrant this use being mentioned in the Boost.EnableIf docs...
>> I agree. Matt, how about making a patch for
>> the docs?
> This is seriously slick, and needs to be added to the enable_if docs
> as soon as possible.
> The example code is a model of clarity, IMO, and should also become
> part of the docs.
I will apply a patch if someone sends one.
-- Jeremiah Willcock
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk