
2013/8/18 Mathias Gaunard
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.htmlhttp://boost.2283326.n4.nabble.com/New-powerful-way-to-use-enable-if-in-C-0x...
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.
I should refer to this: http://lists.boost.org/Archives/boost/2011/08/184468.php Of course it's for C++11 only...