diff --git a/include/boost/type_traits/is_enum.hpp b/include/boost/type_traits/is_enum.hpp index 21b3baa..3b81b7f 100644 --- a/include/boost/type_traits/is_enum.hpp +++ b/include/boost/type_traits/is_enum.hpp @@ -105,6 +105,10 @@ template struct is_enum_impl #if defined(__GNUC__) #ifdef BOOST_TT_HAS_CONFORMING_IS_CLASS_IMPLEMENTATION + + // We MUST check for is_class_or_union on conforming compilers in + // order to correctly deduce that noncopyable types are not enums + // (dwa 2002/04/15)... BOOST_STATIC_CONSTANT(bool, selector = (::boost::type_traits::ice_or< ::boost::is_arithmetic::value @@ -114,6 +118,8 @@ template struct is_enum_impl , is_array::value >::value)); #else + // ...however, not checking is_class_or_union on non-conforming + // compilers prevents a dependency recursion. BOOST_STATIC_CONSTANT(bool, selector = (::boost::type_traits::ice_or< ::boost::is_arithmetic::value @@ -123,16 +129,16 @@ template struct is_enum_impl >::value)); #endif // BOOST_TT_HAS_CONFORMING_IS_CLASS_IMPLEMENTATION -#else +#else // !defined(__GNUC__): + BOOST_STATIC_CONSTANT(bool, selector = (::boost::type_traits::ice_or< ::boost::is_arithmetic::value , ::boost::is_reference::value , is_class_or_union::value , is_array::value - // However, not doing this on non-conforming compilers prevents - // a dependency recursion. >::value)); + #endif #if BOOST_WORKAROUND(__BORLANDC__, < 0x600)