From a603a6a21df8a12756d6dc8dfb8696f6c4b4fb34 Mon Sep 17 00:00:00 2001 From: Dave Abrahams Date: Fri, 22 Jul 2005 16:14:42 +0000 Subject: [PATCH] WOrkaround for https://sourceforge.net/tracker/?func=detail&atid=107586&aid=1242266&group_id=7586 [SVN r30218] --- include/boost/type_traits/is_enum.hpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) 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)