
On Sun, Nov 11, 2012 at 12:29 AM, Evgeny Panasyuk <evgeny.panasyuk@gmail.com
wrote:
11.11.2012 11:20, Gennadiy Rozental wrote:
template<typename T>
inline typename boost::enable_if_c<!boost::is_**float<T>::value, int>::type foo( T&& v );
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:
I have just reproduced this error on MSVC2010. BTW, disable_if_c seems like works:
template<typename T> inline typename boost::disable_if_c<boost::is_**float<T>::value, int>::type foo( T&& v );
template<typename T> inline typename boost::disable_if_c<boost::is_**float<T>::value, int>::type foo( T&& v ) { return 1; }
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. - Jeff