Boost logo

Boost :

Subject: Re: [boost] enable_if quirk? bug?
From: Matt Calabrese (rivorus_at_[hidden])
Date: 2012-11-11 13:41:11


On Sun, Nov 11, 2012 at 2:20 AM, Gennadiy Rozental <rogeeff_at_[hidden]>wrote:

> template<typename T>
> inline typename boost::enable_if_c<!boost::is_float<T>::value, int>::type
> foo( T&& v )
> {
> return 1;
> }
>
> ...
> foo(1);
>
> MSVC 10 producing this error:

Uggg. That's definitely a compiler bug, and a very annoying one at that. As
was suggested, using the type form of enable_if should probably work. On
the plus side, I imagine this bug will be fixed given that there is
std::enable_if now, which takes a boolean constant (and no corresponding
disable_if or type forms), so people even outside of the boost community
will be running into the same problem.

-- 
-Matt Calabrese

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