Boost logo

Boost :

Subject: Re: [boost] enable_if quirk? bug?
From: Evgeny Panasyuk (evgeny.panasyuk_at_[hidden])
Date: 2012-11-11 23:18:36


11.11.2012 22:33, Jeffrey Lee Hellrung, Jr. wrote:

> This is disturbing. I don't have MSVC2010, so I can't investigate, but
> maybe it's the use of "!"? I know MSVC has traditionally been quirky with
> integral constant expressions in template parameters. Gennadiy or Evgeny,
> does
>
> boost::enable_if_c< boost::mpl::not_< boost::is_float<T> >::value, int
>> ::type
>
> work? That, or I think there's an ice_not buried in Boost.TypeTraits
> somewhere.

I have just checked, following code works OK:

template<typename T>
inline typename boost::enable_if_c<boost::mpl::not_< boost::is_float<T>
>::value, int>::type
foo( T&& v );

template<typename T>
inline typename boost::enable_if_c<boost::mpl::not_< boost::is_float<T>
>::value, int>::type
foo( T&& v )
{
     return 1;
}

-- 
Evgeny Panasyuk

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