// (C) Copyright Runar Undheim, Robert Ramey & John Maddock 2000. // Use, modification and distribution are subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt). // // See http://www.boost.org/libs/type_traits for most recent version including documentation. #ifndef BOOST_TT_HAS_NEW_OPERATOR_HPP_INCLUDED #define BOOST_TT_HAS_NEW_OPERATOR_HPP_INCLUDED #include #include #include #include // should be the last #include #include namespace boost { namespace detail { template struct test; template struct has_new_operator_impl { template static type_traits::yes_type check_sig( U*, test< void *(*)(size_t), &U::operator new >* = NULL ); template static type_traits::no_type check_sig(...); // GCC2 won't even parse this template if we embed the computation // of s1 in the computation of value. #ifdef __GNUC__ BOOST_STATIC_CONSTANT(unsigned, s1 = sizeof(has_new_operator::template check_sig(0))); #else #if BOOST_WORKAROUND(_MSC_FULL_VER, >= 140050000) #pragma warning(push) #pragma warning(disable:6334) #endif BOOST_STATIC_CONSTANT(unsigned, s1 = sizeof(check_sig(0))); #if BOOST_WORKAROUND(_MSC_FULL_VER, >= 140050000) #pragma warning(pop) #endif #endif BOOST_STATIC_CONSTANT(bool, value = (s1 == sizeof(type_traits::yes_type))); }; } // namespace detail BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_new_operator,T,::boost::detail::has_new_operator_impl::value) } // namespace boost #include #endif // BOOST_TT_HAS_NEW_OPERATOR_HPP_INCLUDED