summaryrefslogtreecommitdiff
path: root/boost/type_traits/is_empty.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'boost/type_traits/is_empty.hpp')
-rw-r--r--boost/type_traits/is_empty.hpp38
1 files changed, 8 insertions, 30 deletions
diff --git a/boost/type_traits/is_empty.hpp b/boost/type_traits/is_empty.hpp
index adb239ee24..ef288c518b 100644
--- a/boost/type_traits/is_empty.hpp
+++ b/boost/type_traits/is_empty.hpp
@@ -10,16 +10,12 @@
#define BOOST_TT_IS_EMPTY_HPP_INCLUDED
#include <boost/type_traits/is_convertible.hpp>
-#include <boost/type_traits/detail/ice_or.hpp>
-#include <boost/type_traits/config.hpp>
+#include <boost/type_traits/detail/config.hpp>
#include <boost/type_traits/intrinsics.hpp>
-# include <boost/type_traits/remove_cv.hpp>
-# include <boost/type_traits/is_class.hpp>
-# include <boost/type_traits/add_reference.hpp>
-
-// should be always the last #include directive
-#include <boost/type_traits/detail/bool_trait_def.hpp>
+#include <boost/type_traits/remove_cv.hpp>
+#include <boost/type_traits/is_class.hpp>
+#include <boost/type_traits/add_reference.hpp>
#ifndef BOOST_INTERNAL_IS_EMPTY
#define BOOST_INTERNAL_IS_EMPTY(T) false
@@ -75,12 +71,8 @@ struct is_empty_impl
{
typedef typename remove_cv<T>::type cvt;
BOOST_STATIC_CONSTANT(
- bool, value = (
- ::boost::type_traits::ice_or<
- ::boost::detail::empty_helper<cvt,::boost::is_class<T>::value>::value
- , BOOST_INTERNAL_IS_EMPTY(cvt)
- >::value
- ));
+ bool,
+ value = ( ::boost::detail::empty_helper<cvt,::boost::is_class<T>::value>::value || BOOST_INTERNAL_IS_EMPTY(cvt)));
};
#else // __BORLANDC__
@@ -107,35 +99,21 @@ struct is_empty_impl
BOOST_STATIC_CONSTANT(
bool, value = (
- ::boost::type_traits::ice_or<
::boost::detail::empty_helper<
cvt
, ::boost::is_class<T>::value
, ::boost::is_convertible< r_type,int>::value
- >::value
- , BOOST_INTERNAL_IS_EMPTY(cvt)
- >::value));
+ >::value || BOOST_INTERNAL_IS_EMPTY(cvt));
};
#endif // __BORLANDC__
-
-// these help when the compiler has no partial specialization support:
-BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_empty,void,false)
-#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS
-BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_empty,void const,false)
-BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_empty,void volatile,false)
-BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_empty,void const volatile,false)
-#endif
-
} // namespace detail
-BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_empty,T,::boost::detail::is_empty_impl<T>::value)
+template <class T> struct is_empty : integral_constant<bool, ::boost::detail::is_empty_impl<T>::value> {};
} // namespace boost
-#include <boost/type_traits/detail/bool_trait_undef.hpp>
-
#undef BOOST_INTERNAL_IS_EMPTY
#endif // BOOST_TT_IS_EMPTY_HPP_INCLUDED