diff --git a/include/boost/python/detail/def_helper.hpp b/include/boost/python/detail/def_helper.hpp index 4c70fd8f..106f3677 100644 --- a/include/boost/python/detail/def_helper.hpp +++ b/include/boost/python/detail/def_helper.hpp @@ -65,7 +65,7 @@ namespace detail struct tuple_extract_base_select { typedef typename Tuple::head_type head_type; - typedef typename mpl::apply1::type match_t; + typedef typename mpl::apply1::type>::type match_t; BOOST_STATIC_CONSTANT(bool, match = match_t::value); typedef typename tuple_extract_impl::template apply type; }; @@ -85,7 +85,7 @@ namespace detail Tuple, mpl::logical_not< is_reference_to_class< - add_reference + mpl::_1 > > > { @@ -93,7 +93,7 @@ namespace detail template struct keyword_extract - : tuple_extract > > + : tuple_extract > { }; @@ -103,8 +103,8 @@ namespace detail Tuple, mpl::logical_and< mpl::logical_not > - , is_reference_to_class > - , mpl::logical_not > > + , is_reference_to_class + , mpl::logical_not > > > { @@ -115,20 +115,18 @@ namespace detail : tuple_extract< Tuple, mpl::logical_or< - is_reference_to_function_pointer - , is_reference_to_function - , is_same + is_reference_to_function_pointer + , is_reference_to_function > > { }; -# define BOOST_PYTHON_DEF_HELPER_TAIL default_call_policies, keywords<0>, char const* template struct def_helper { typedef boost::tuples::tuple< - T1 const&, T2 const&, T3 const&, default_call_policies, keywords<0>, char const* + T1 const&, T2 const&, T3 const&, default_call_policies, keywords<0>, char const*, void(*)() > all_t; def_helper(T1 const& a1) : m_all(a1,m_nil,m_nil) {} @@ -150,8 +148,14 @@ namespace detail return policy_extract::extract(m_all); } - typedef - typename default_implementation_extract::result_type default_implementation() const + private: + typedef typename default_implementation_extract::result_type default_implementation_t; + public: + BOOST_STATIC_CONSTANT( + bool, has_default_implementation = ( + !is_same::value)); + + default_implementation_t default_implementation() const { return policy_extract::extract(m_all); } diff --git a/include/boost/python/detail/indirect_traits.hpp b/include/boost/python/detail/indirect_traits.hpp index 23d14a64..cd4ad666 100644 --- a/include/boost/python/detail/indirect_traits.hpp +++ b/include/boost/python/detail/indirect_traits.hpp @@ -101,6 +101,7 @@ struct is_reference_to_function_pointer_aux typename remove_reference::type >::type >::value)); + typedef mpl::bool_c type; }; template @@ -274,12 +275,14 @@ struct is_pointer_to_function_aux BOOST_STATIC_CONSTANT( bool, value = sizeof(::boost::type_traits::is_function_ptr_tester(t)) == sizeof(::boost::type_traits::yes_type)); + typedef mpl::bool_c type; }; template struct is_pointer_to_function : mpl::if_, is_pointer_to_function_aux, mpl::bool_c >::type { + BOOST_MPL_AUX_LAMBDA_SUPPORT(1,is_pointer_to_function,(T)) }; struct false_helper1 @@ -399,6 +402,7 @@ struct is_reference_to_function_pointer : mpl::if_ , is_pointer_to_function_aux, mpl::bool_c >::type { + BOOST_MPL_AUX_LAMBDA_SUPPORT(1,is_reference_to_function_pointer,(T)) }; template