Workaround an Intel bug; added tests for it too.

[SVN r21883]
This commit is contained in:
Dave Abrahams
2004-01-23 00:07:25 +00:00
parent 7f3b917cea
commit c3724f6bea
2 changed files with 11 additions and 24 deletions

View File

@ -17,10 +17,6 @@
#ifdef BOOST_TT_HAS_CONFORMING_IS_CLASS_IMPLEMENTATION
# include "boost/type_traits/detail/yes_no_type.hpp"
# ifdef __EDG_VERSION__
# include "boost/type_traits/is_const.hpp"
# include "boost/type_traits/is_volatile.hpp"
# endif
#else
# include "boost/type_traits/is_scalar.hpp"
# include "boost/type_traits/is_array.hpp"
@ -29,6 +25,10 @@
# include "boost/type_traits/is_function.hpp"
#endif
#ifdef __EDG_VERSION__
# include "boost/type_traits/remove_cv.hpp"
#endif
// should be the last #include
#include "boost/type_traits/detail/bool_trait_def.hpp"
@ -81,25 +81,6 @@ struct is_class_impl
);
};
# ifdef __EDG_VERSION__
template <typename T>
struct is_class_impl<T const>
: is_class_impl<T>
{
};
template <typename T>
struct is_class_impl<T volatile>
: is_class_impl<T>
{
};
template <typename T>
struct is_class_impl<T const volatile>
: is_class_impl<T>
{
};
# endif
#endif
#else
@ -133,8 +114,13 @@ struct is_class_impl
} // namespace detail
# ifdef __EDG_VERSION__
BOOST_TT_AUX_BOOL_TRAIT_DEF1(
is_class,T, detail::is_class_impl<typename remove_cv<T>::type>::value)
# else
BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_class,T,::boost::detail::is_class_impl<T>::value)
# endif
} // namespace boost
#include "boost/type_traits/detail/bool_trait_undef.hpp"

View File

@ -21,6 +21,7 @@ TT_TEST_BEGIN(is_class)
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_class<int*>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_class<int* const>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_class<int[2]>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_class<int const[2]>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_class<int&>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_class<mf4>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_class<f1>::value, false);