summaryrefslogtreecommitdiff
path: root/boost/type_traits/is_base_of.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'boost/type_traits/is_base_of.hpp')
-rw-r--r--boost/type_traits/is_base_of.hpp26
1 files changed, 8 insertions, 18 deletions
diff --git a/boost/type_traits/is_base_of.hpp b/boost/type_traits/is_base_of.hpp
index 3655b0bd23..89f2f67980 100644
--- a/boost/type_traits/is_base_of.hpp
+++ b/boost/type_traits/is_base_of.hpp
@@ -12,11 +12,6 @@
#include <boost/type_traits/is_base_and_derived.hpp>
#include <boost/type_traits/is_same.hpp>
#include <boost/type_traits/is_class.hpp>
-#include <boost/type_traits/detail/ice_or.hpp>
-#include <boost/type_traits/detail/ice_and.hpp>
-
-// should be the last #include
-#include <boost/type_traits/detail/bool_trait_def.hpp>
namespace boost {
@@ -26,24 +21,19 @@ namespace boost {
{
typedef typename remove_cv<B>::type ncvB;
typedef typename remove_cv<D>::type ncvD;
- BOOST_STATIC_CONSTANT(bool, value = (::boost::type_traits::ice_or<
- (::boost::detail::is_base_and_derived_impl<ncvB,ncvD>::value),
- (::boost::type_traits::ice_and< ::boost::is_same<ncvB,ncvD>::value, ::boost::is_class<ncvB>::value>::value)>::value));
+ BOOST_STATIC_CONSTANT(bool, value = (
+ (::boost::detail::is_base_and_derived_impl<ncvB,ncvD>::value) ||
+ (::boost::is_same<ncvB,ncvD>::value && ::boost::is_class<ncvB>::value)));
};
}
-BOOST_TT_AUX_BOOL_TRAIT_DEF2(
- is_base_of
- , Base
- , Derived
- , (::boost::detail::is_base_of_imp<Base, Derived>::value))
+ template <class Base, class Derived> struct is_base_of
+ : public integral_constant<bool, (::boost::detail::is_base_of_imp<Base, Derived>::value)> {};
-BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC2_2(typename Base,typename Derived,is_base_of,Base&,Derived,false)
-BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC2_2(typename Base,typename Derived,is_base_of,Base,Derived&,false)
-BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC2_2(typename Base,typename Derived,is_base_of,Base&,Derived&,false)
+ template <class Base, class Derived> struct is_base_of<Base, Derived&> : false_type{};
+ template <class Base, class Derived> struct is_base_of<Base&, Derived&> : false_type{};
+ template <class Base, class Derived> struct is_base_of<Base&, Derived> : false_type{};
} // namespace boost
-#include <boost/type_traits/detail/bool_trait_undef.hpp>
-
#endif // BOOST_TT_IS_BASE_AND_DERIVED_HPP_INCLUDED