-\r
-// (C) Copyright Runar Undheim, Robert Ramey & John Maddock 2008.\r
-// Use, modification and distribution are subject to the Boost Software License,\r
-// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at\r
-// http://www.boost.org/LICENSE_1_0.txt).\r
-//\r
-// See http://www.boost.org/libs/type_traits for most recent version including documentation.\r
-\r
-#ifndef BOOST_TT_HAS_NEW_OPERATOR_HPP_INCLUDED\r
-#define BOOST_TT_HAS_NEW_OPERATOR_HPP_INCLUDED\r
-\r
-#include <new> // std::nothrow_t\r
-#include <cstddef> // std::size_t\r
-#include <boost/type_traits/config.hpp>\r
-#include <boost/type_traits/detail/yes_no_type.hpp>\r
-#include <boost/type_traits/detail/ice_or.hpp>\r
-\r
-// should be the last #include\r
-#include <boost/type_traits/detail/bool_trait_def.hpp>\r
-\r
-namespace boost {\r
-namespace detail {\r
- template <class U, U x> \r
- struct test;\r
-\r
- template <typename T>\r
- struct has_new_operator_impl {\r
- template<class U>\r
- static type_traits::yes_type check_sig(\r
- U*, \r
- test<\r
- void *(*)(std::size_t),\r
- &U::operator new\r
- >* = NULL\r
- );\r
- template<class U>\r
- static type_traits::yes_type check_sig(\r
- U*, \r
- test<\r
- void *(*)(std::size_t, const std::nothrow_t&),\r
- &U::operator new\r
- >* = NULL\r
- );\r
- template<class U>\r
- static type_traits::yes_type check_sig(\r
- U*, \r
- test<\r
- void *(*)(std::size_t, void*),\r
- &U::operator new\r
- >* = NULL\r
- );\r
- template<class U>\r
- static type_traits::no_type check_sig(...);\r
-\r
- template<class U>\r
- static type_traits::yes_type check_sig2(\r
- U*, \r
- test<\r
- void *(*)(std::size_t),\r
- &U::operator new[]\r
- >* = NULL\r
- );\r
- template<class U>\r
- static type_traits::yes_type check_sig2(\r
- U*, \r
- test<\r
- void *(*)(std::size_t, const std::nothrow_t&),\r
- &U::operator new[]\r
- >* = NULL\r
- );\r
- template<class U>\r
- static type_traits::yes_type check_sig2(\r
- U*, \r
- test<\r
- void *(*)(std::size_t, void*),\r
- &U::operator new[]\r
- >* = NULL\r
- );\r
- template<class U>\r
- static type_traits::no_type check_sig2(...);\r
-\r
- // GCC2 won't even parse this template if we embed the computation\r
- // of s1 in the computation of value.\r
- #ifdef __GNUC__\r
- BOOST_STATIC_CONSTANT(unsigned, s1 = sizeof(has_new_operator_impl<T>::template check_sig<T>(0)));\r
- BOOST_STATIC_CONSTANT(unsigned, s2 = sizeof(has_new_operator_impl<T>::template check_sig2<T>(0)));\r
- #else\r
- #if BOOST_WORKAROUND(BOOST_MSVC_FULL_VER, >= 140050000)\r
- #pragma warning(push)\r
- #pragma warning(disable:6334)\r
- #endif\r
-\r
- BOOST_STATIC_CONSTANT(unsigned, s1 = sizeof(check_sig<T>(0)));\r
- BOOST_STATIC_CONSTANT(unsigned, s2 = sizeof(check_sig2<T>(0)));\r
-\r
- #if BOOST_WORKAROUND(BOOST_MSVC_FULL_VER, >= 140050000)\r
- #pragma warning(pop)\r
- #endif\r
- #endif\r
- BOOST_STATIC_CONSTANT(bool, value = \r
- (::boost::type_traits::ice_or<\r
- (s1 == sizeof(type_traits::yes_type)),\r
- (s2 == sizeof(type_traits::yes_type))\r
- >::value)\r
- );\r
- };\r
-} // namespace detail\r
-\r
-BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_new_operator,T,::boost::detail::has_new_operator_impl<T>::value)\r
-\r
-} // namespace boost\r
-\r
-#include <boost/type_traits/detail/bool_trait_undef.hpp>\r
-\r
-#endif // BOOST_TT_HAS_NEW_OPERATOR_HPP_INCLUDED\r
+
+// (C) Copyright Runar Undheim, Robert Ramey & John Maddock 2008.
+// 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 <new> // std::nothrow_t
+#include <cstddef> // std::size_t
+#include <boost/type_traits/config.hpp>
+#include <boost/type_traits/detail/yes_no_type.hpp>
+#include <boost/type_traits/detail/ice_or.hpp>
+
+// should be the last #include
+#include <boost/type_traits/detail/bool_trait_def.hpp>
+
+namespace boost {
+namespace detail {
+ template <class U, U x>
+ struct test;
+
+ template <typename T>
+ struct has_new_operator_impl {
+ template<class U>
+ static type_traits::yes_type check_sig1(
+ U*,
+ test<
+ void *(*)(std::size_t),
+ &U::operator new
+ >* = NULL
+ );
+ template<class U>
+ static type_traits::no_type check_sig1(...);
+
+ template<class U>
+ static type_traits::yes_type check_sig2(
+ U*,
+ test<
+ void *(*)(std::size_t, const std::nothrow_t&),
+ &U::operator new
+ >* = NULL
+ );
+ template<class U>
+ static type_traits::no_type check_sig2(...);
+
+ template<class U>
+ static type_traits::yes_type check_sig3(
+ U*,
+ test<
+ void *(*)(std::size_t, void*),
+ &U::operator new
+ >* = NULL
+ );
+ template<class U>
+ static type_traits::no_type check_sig3(...);
+
+
+ template<class U>
+ static type_traits::yes_type check_sig4(
+ U*,
+ test<
+ void *(*)(std::size_t),
+ &U::operator new[]
+ >* = NULL
+ );
+ template<class U>
+ static type_traits::no_type check_sig4(...);
+
+ template<class U>
+ static type_traits::yes_type check_sig5(
+ U*,
+ test<
+ void *(*)(std::size_t, const std::nothrow_t&),
+ &U::operator new[]
+ >* = NULL
+ );
+ template<class U>
+ static type_traits::no_type check_sig5(...);
+
+ template<class U>
+ static type_traits::yes_type check_sig6(
+ U*,
+ test<
+ void *(*)(std::size_t, void*),
+ &U::operator new[]
+ >* = NULL
+ );
+ template<class U>
+ static type_traits::no_type check_sig6(...);
+
+ // 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_impl<T>::template check_sig1<T>(0)));
+ BOOST_STATIC_CONSTANT(unsigned, s2 = sizeof(has_new_operator_impl<T>::template check_sig2<T>(0)));
+ BOOST_STATIC_CONSTANT(unsigned, s3 = sizeof(has_new_operator_impl<T>::template check_sig3<T>(0)));
+ BOOST_STATIC_CONSTANT(unsigned, s4 = sizeof(has_new_operator_impl<T>::template check_sig4<T>(0)));
+ BOOST_STATIC_CONSTANT(unsigned, s5 = sizeof(has_new_operator_impl<T>::template check_sig5<T>(0)));
+ BOOST_STATIC_CONSTANT(unsigned, s6 = sizeof(has_new_operator_impl<T>::template check_sig6<T>(0)));
+ #else
+ #if BOOST_WORKAROUND(BOOST_MSVC_FULL_VER, >= 140050000)
+ #pragma warning(push)
+ #pragma warning(disable:6334)
+ #endif
+
+ BOOST_STATIC_CONSTANT(unsigned, s1 = sizeof(check_sig1<T>(0)));
+ BOOST_STATIC_CONSTANT(unsigned, s2 = sizeof(check_sig2<T>(0)));
+ BOOST_STATIC_CONSTANT(unsigned, s3 = sizeof(check_sig3<T>(0)));
+ BOOST_STATIC_CONSTANT(unsigned, s4 = sizeof(check_sig4<T>(0)));
+ BOOST_STATIC_CONSTANT(unsigned, s5 = sizeof(check_sig5<T>(0)));
+ BOOST_STATIC_CONSTANT(unsigned, s6 = sizeof(check_sig6<T>(0)));
+
+ #if BOOST_WORKAROUND(BOOST_MSVC_FULL_VER, >= 140050000)
+ #pragma warning(pop)
+ #endif
+ #endif
+ BOOST_STATIC_CONSTANT(bool, value =
+ (::boost::type_traits::ice_or<
+ (s1 == sizeof(type_traits::yes_type)),
+ (s2 == sizeof(type_traits::yes_type)),
+ (s3 == sizeof(type_traits::yes_type)),
+ (s4 == sizeof(type_traits::yes_type)),
+ (s5 == sizeof(type_traits::yes_type)),
+ (s6 == sizeof(type_traits::yes_type))
+ >::value)
+ );
+ };
+} // namespace detail
+
+BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_new_operator,T,::boost::detail::has_new_operator_impl<T>::value)
+
+} // namespace boost
+
+#include <boost/type_traits/detail/bool_trait_undef.hpp>
+
+#endif // BOOST_TT_HAS_NEW_OPERATOR_HPP_INCLUDED