Subject: Re: [boost] Is there BOOST_ENABLE_IF macro now?
From: Mathias Gaunard (mathias.gaunard_at_[hidden])
Date: 2013-08-18 10:43:03


On 18/08/13 08:30, TONGARI J wrote:
> Hi folks,
>
> It's over 2 years since this post:
> http://boost.2283326.n4.nabble.com/New-powerful-way-to-use-enable-if-in-C-0x-td3442723.html
>
> The macro looks sweet and I wonder if we have this macro in Boost in case
> that I missed it.

What's the practical reason of having a macro?

The approaches suggested in the thread all have limitations. For example
they require you to put some unique non-ambiguous type in all your
overloads of a said function.

The classical approach recommended for enable_if is still the best way
to use SFINAE for a boolean meta-function or a boolean constant expression.

For this one, you're better off just knowing what you're doing than to
rely on macro magic.