diff --git a/include/boost/python/args.hpp b/include/boost/python/args.hpp index 8f8791d7..55d1283b 100644 --- a/include/boost/python/args.hpp +++ b/include/boost/python/args.hpp @@ -102,7 +102,6 @@ namespace detail return this->operator,(python::arg(name)); } -# ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION template struct is_keywords { @@ -126,31 +125,6 @@ namespace detail typedef mpl::bool_ type; BOOST_PYTHON_MPL_LAMBDA_SUPPORT(1,is_reference_to_keywords,(T)) }; -# else - typedef char (&yes_keywords_t)[1]; - typedef char (&no_keywords_t)[2]; - - no_keywords_t is_keywords_test(...); - - template - yes_keywords_t is_keywords_test(void (*)(keywords&)); - - template - yes_keywords_t is_keywords_test(void (*)(keywords const&)); - - template - class is_reference_to_keywords - { - public: - BOOST_STATIC_CONSTANT( - bool, value = ( - sizeof(detail::is_keywords_test( (void (*)(T))0 )) - == sizeof(detail::yes_keywords_t))); - - typedef mpl::bool_ type; - BOOST_PYTHON_MPL_LAMBDA_SUPPORT(1,is_reference_to_keywords,(T)) - }; -# endif } inline detail::keywords<1> args(char const* name) diff --git a/include/boost/python/back_reference.hpp b/include/boost/python/back_reference.hpp index c1daba60..e68066f7 100644 --- a/include/boost/python/back_reference.hpp +++ b/include/boost/python/back_reference.hpp @@ -29,7 +29,6 @@ struct back_reference T m_value; }; -# ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION template class is_back_reference { @@ -44,36 +43,6 @@ class is_back_reference > BOOST_STATIC_CONSTANT(bool, value = true); }; -# else // no partial specialization - -}} // namespace boost::python - -#include - -namespace boost { namespace python { - -namespace detail -{ - typedef char (&yes_back_reference_t)[1]; - typedef char (&no_back_reference_t)[2]; - - no_back_reference_t is_back_reference_test(...); - - template - yes_back_reference_t is_back_reference_test(boost::type< back_reference >); -} - -template -class is_back_reference -{ - public: - BOOST_STATIC_CONSTANT( - bool, value = ( - sizeof(detail::is_back_reference_test(boost::type())) - == sizeof(detail::yes_back_reference_t))); -}; - -# endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION // // implementations diff --git a/include/boost/python/bases.hpp b/include/boost/python/bases.hpp index 0bd7350e..614d6223 100644 --- a/include/boost/python/bases.hpp +++ b/include/boost/python/bases.hpp @@ -24,7 +24,6 @@ namespace boost { namespace python { namespace detail { -# ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION template struct specifies_bases : mpl::false_ { @@ -35,23 +34,6 @@ namespace boost { namespace python { : mpl::true_ { }; -# else - template < BOOST_PP_ENUM_PARAMS(BOOST_PYTHON_MAX_BASES, class Base) > - static char is_bases_helper(bases< BOOST_PYTHON_BASE_PARAMS > const&); - - static char (& is_bases_helper(...) )[256]; - - template - struct specifies_bases - { - private: - static typename add_reference::type make(); - BOOST_STATIC_CONSTANT(bool, non_ref = !is_reference::value); - public: - BOOST_STATIC_CONSTANT(bool, value = non_ref & (sizeof(is_bases_helper(make())) == 1)); - typedef mpl::bool_ type; - }; -# endif template > struct select_bases : mpl::if_< diff --git a/include/boost/python/converter/object_manager.hpp b/include/boost/python/converter/object_manager.hpp old mode 100755 new mode 100644 index 84e44d47..46682455 --- a/include/boost/python/converter/object_manager.hpp +++ b/include/boost/python/converter/object_manager.hpp @@ -121,7 +121,6 @@ struct is_object_manager { }; -# ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION template struct is_reference_to_object_manager : mpl::false_ @@ -151,79 +150,6 @@ struct is_reference_to_object_manager : is_object_manager { }; -# else - -namespace detail -{ - typedef char (&yes_reference_to_object_manager)[1]; - typedef char (&no_reference_to_object_manager)[2]; - - // A number of nastinesses go on here in order to work around MSVC6 - // bugs. - template - struct is_object_manager_help - { - typedef typename mpl::if_< - is_object_manager - , yes_reference_to_object_manager - , no_reference_to_object_manager - >::type type; - - // If we just use the type instead of the result of calling this - // function, VC6 will ICE. - static type call(); - }; - - // A set of overloads for each cv-qualification. The same argument - // is passed twice: the first one is used to unwind the cv*, and the - // second one is used to avoid relying on partial ordering for - // overload resolution. - template - typename is_object_manager_help - is_object_manager_helper(U*, void*); - - template - typename is_object_manager_help - is_object_manager_helper(U const*, void const*); - - template - typename is_object_manager_help - is_object_manager_helper(U volatile*, void volatile*); - - template - typename is_object_manager_help - is_object_manager_helper(U const volatile*, void const volatile*); - - template - struct is_reference_to_object_manager_nonref - : mpl::false_ - { - }; - - template - struct is_reference_to_object_manager_ref - { - static T sample_object; - BOOST_STATIC_CONSTANT( - bool, value - = (sizeof(is_object_manager_helper(&sample_object, &sample_object).call()) - == sizeof(detail::yes_reference_to_object_manager) - ) - ); - typedef mpl::bool_ type; - }; -} - -template -struct is_reference_to_object_manager - : mpl::if_< - is_reference - , detail::is_reference_to_object_manager_ref - , detail::is_reference_to_object_manager_nonref - >::type -{ -}; -# endif }}} // namespace boost::python::converter diff --git a/include/boost/python/converter/registered_pointee.hpp b/include/boost/python/converter/registered_pointee.hpp index d9e7ac75..974cb6d8 100644 --- a/include/boost/python/converter/registered_pointee.hpp +++ b/include/boost/python/converter/registered_pointee.hpp @@ -14,7 +14,6 @@ namespace boost { namespace python { namespace converter { struct registration; -# ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION template struct registered_pointee : registered< @@ -26,37 +25,6 @@ struct registered_pointee > { }; -# else -namespace detail -{ - template - struct registered_pointee_base - { - static registration const& converters; - }; -} - -template -struct registered_pointee - : detail::registered_pointee_base< - typename add_reference< - typename add_cv::type - >::type - > -{ -}; - -// -// implementations -// -namespace detail -{ - template - registration const& registered_pointee_base::converters - = registry::lookup(pointer_type_id()); -} - -# endif }}} // namespace boost::python::converter #endif // REGISTERED_POINTEE_DWA2002710_HPP diff --git a/include/boost/python/detail/borrowed_ptr.hpp b/include/boost/python/detail/borrowed_ptr.hpp old mode 100755 new mode 100644 index b88457b8..d91d05c9 --- a/include/boost/python/detail/borrowed_ptr.hpp +++ b/include/boost/python/detail/borrowed_ptr.hpp @@ -19,7 +19,6 @@ template class borrowed typedef T type; }; -# ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION template struct is_borrowed_ptr { @@ -68,35 +67,6 @@ struct is_borrowed_ptr }; # endif -# else // no partial specialization - -typedef char (&yes_borrowed_ptr_t)[1]; -typedef char (&no_borrowed_ptr_t)[2]; - -no_borrowed_ptr_t is_borrowed_ptr_test(...); - -template -typename mpl::if_c< - is_pointer::value - , T - , int - >::type -is_borrowed_ptr_test1(boost::type); - -template -yes_borrowed_ptr_t is_borrowed_ptr_test(borrowed const volatile*); - -template -class is_borrowed_ptr -{ - public: - BOOST_STATIC_CONSTANT( - bool, value = ( - sizeof(detail::is_borrowed_ptr_test(is_borrowed_ptr_test1(boost::type()))) - == sizeof(detail::yes_borrowed_ptr_t))); -}; - -# endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION } diff --git a/include/boost/python/detail/referent_storage.hpp b/include/boost/python/detail/referent_storage.hpp index 0a1ef5a0..2cddf696 100644 --- a/include/boost/python/detail/referent_storage.hpp +++ b/include/boost/python/detail/referent_storage.hpp @@ -42,7 +42,6 @@ union aligned_storage // but sizeof() is broken in CodeWarriors <= 8.0 template struct referent_size; -# ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION template struct referent_size @@ -51,15 +50,6 @@ union aligned_storage std::size_t, value = sizeof(T)); }; -# else - - template struct referent_size - { - static T f(); - BOOST_STATIC_CONSTANT(std::size_t, value = sizeof(f())); - }; - -# endif // A metafunction returning a POD type which can store U, where T == // U&. If T is not a reference type, returns a POD which can store T. diff --git a/include/boost/python/detail/string_literal.hpp b/include/boost/python/detail/string_literal.hpp index 50193b64..a56e72ec 100644 --- a/include/boost/python/detail/string_literal.hpp +++ b/include/boost/python/detail/string_literal.hpp @@ -14,7 +14,6 @@ namespace boost { namespace python { namespace detail { -# ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION template struct is_string_literal : mpl::false_ { @@ -45,43 +44,6 @@ struct is_string_literal { }; # endif -# else -template -struct string_literal_helper -{ - typedef char (&yes_string_literal)[1]; - typedef char (&no_string_literal)[2]; - - template - struct apply - { - typedef apply self; - static T x; - static yes_string_literal check(char const*); - static no_string_literal check(char*); - static no_string_literal check(void const volatile*); - - BOOST_STATIC_CONSTANT( - bool, value = sizeof(self::check(x)) == sizeof(yes_string_literal)); - typedef mpl::bool_ type; - }; -}; - -template <> -struct string_literal_helper -{ - template - struct apply : mpl::false_ - { - }; -}; - -template -struct is_string_literal - : string_literal_helper::value>::apply -{ -}; -# endif }}} // namespace boost::python::detail diff --git a/include/boost/python/handle.hpp b/include/boost/python/handle.hpp index 8208f3ab..ee9a7cd0 100644 --- a/include/boost/python/handle.hpp +++ b/include/boost/python/handle.hpp @@ -155,7 +155,6 @@ typedef handle type_handle; // // Compile-time introspection // -# ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION template class is_handle { @@ -169,28 +168,6 @@ class is_handle > public: BOOST_STATIC_CONSTANT(bool, value = true); }; -# else -namespace detail -{ - typedef char (&yes_handle_t)[1]; - typedef char (&no_handle_t)[2]; - - no_handle_t is_handle_test(...); - - template - yes_handle_t is_handle_test(boost::type< handle >); -} - -template -class is_handle -{ - public: - BOOST_STATIC_CONSTANT( - bool, value = ( - sizeof(detail::is_handle_test(boost::type())) - == sizeof(detail::yes_handle_t))); -}; -# endif // // implementations diff --git a/include/boost/python/object/forward.hpp b/include/boost/python/object/forward.hpp index 83182bfb..30613d8e 100644 --- a/include/boost/python/object/forward.hpp +++ b/include/boost/python/object/forward.hpp @@ -43,7 +43,6 @@ struct forward { }; -# ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION template struct unforward { @@ -70,88 +69,6 @@ struct unforward_cref > { }; -# else // no partial specialization - -namespace detail -{ - typedef char (&yes_reference_to_value_t)[1]; - typedef char (&no_reference_to_value_t)[2]; - - no_reference_to_value_t is_reference_to_value_test(...); - - template - yes_reference_to_value_t is_reference_to_value_test(boost::type< reference_to_value >); - - template - struct unforwarder - { - template - struct apply - { - typedef typename unwrap_reference::type& type; - }; - }; - - template<> - struct unforwarder - { - template - struct apply - { - typedef typename T::reference type; - }; - }; - - template - struct cref_unforwarder - { - template - struct apply - : python::detail::value_arg< - typename unwrap_reference::type - > - { - }; - }; - - template<> - struct cref_unforwarder - { - template - struct apply - : python::detail::value_arg< - typename T::reference - > - { - }; - }; - - template - struct is_reference_to_value - { - BOOST_STATIC_CONSTANT( - bool, value = ( - sizeof(is_reference_to_value_test(boost::type())) - == sizeof(yes_reference_to_value_t))); - typedef mpl::bool_ type; - }; -} - -template -struct unforward - : public detail::unforwarder< - detail::is_reference_to_value::value - >::template apply -{}; - -template -struct unforward_cref - : public detail::cref_unforwarder< - detail::is_reference_to_value::value - >::template apply -{}; - -# endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION template typename reference_to_value::reference diff --git a/include/boost/python/other.hpp b/include/boost/python/other.hpp index 7cd6fa04..24a24ad8 100644 --- a/include/boost/python/other.hpp +++ b/include/boost/python/other.hpp @@ -18,7 +18,6 @@ template struct other typedef T type; }; -# ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION namespace detail { template @@ -49,63 +48,6 @@ namespace detail typedef T type; }; } -# else // no partial specialization - -}} // namespace boost::python - -#include - -namespace boost { namespace python { - -namespace detail -{ - typedef char (&yes_other_t)[1]; - typedef char (&no_other_t)[2]; - - no_other_t is_other_test(...); - - template - yes_other_t is_other_test(type< other >); - - template - struct other_unwrapper - { - template - struct apply - { - typedef T type; - }; - }; - - template<> - struct other_unwrapper - { - template - struct apply - { - typedef typename T::type type; - }; - }; - - template - class is_other - { - public: - BOOST_STATIC_CONSTANT( - bool, value = ( - sizeof(detail::is_other_test(type())) - == sizeof(detail::yes_other_t))); - }; - - template - class unwrap_other - : public detail::other_unwrapper< - is_other::value - >::template apply - {}; -} - -# endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION }} // namespace boost::python diff --git a/include/boost/python/ptr.hpp b/include/boost/python/ptr.hpp index 0152459c..287daba4 100644 --- a/include/boost/python/ptr.hpp +++ b/include/boost/python/ptr.hpp @@ -36,7 +36,6 @@ inline pointer_wrapper ptr(T t) return pointer_wrapper(t); } -# ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION template class is_pointer_wrapper : public mpl::false_ @@ -62,64 +61,6 @@ class unwrap_pointer > public: typedef T type; }; -# else // no partial specialization - -}} // namespace boost::python - -#include - -namespace boost { namespace python { - -namespace detail -{ - typedef char (&yes_pointer_wrapper_t)[1]; - typedef char (&no_pointer_wrapper_t)[2]; - - no_pointer_wrapper_t is_pointer_wrapper_test(...); - - template - yes_pointer_wrapper_t is_pointer_wrapper_test(boost::type< pointer_wrapper >); - - template - struct pointer_unwrapper - { - template - struct apply - { - typedef T type; - }; - }; - - template<> - struct pointer_unwrapper - { - template - struct apply - { - typedef typename T::type type; - }; - }; -} - -template -class is_pointer_wrapper -{ - public: - BOOST_STATIC_CONSTANT( - bool, value = ( - sizeof(detail::is_pointer_wrapper_test(boost::type())) - == sizeof(detail::yes_pointer_wrapper_t))); - typedef mpl::bool_ type; -}; - -template -class unwrap_pointer - : public detail::pointer_unwrapper< - is_pointer_wrapper::value - >::template apply -{}; - -# endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION }} // namespace boost::python