From 6835c344eb191a77fdb7a83fbd24e754072d5cce Mon Sep 17 00:00:00 2001 From: Dave Abrahams Date: Tue, 2 Apr 2002 21:08:55 +0000 Subject: [PATCH] Simplified fix [SVN r13347] --- include/boost/python/detail/wrap_function.hpp | 35 ++++--------------- 1 file changed, 7 insertions(+), 28 deletions(-) diff --git a/include/boost/python/detail/wrap_function.hpp b/include/boost/python/detail/wrap_function.hpp index 682b3e89..0dcccd70 100644 --- a/include/boost/python/detail/wrap_function.hpp +++ b/include/boost/python/detail/wrap_function.hpp @@ -9,6 +9,8 @@ # include # include # include +# include +# include # include namespace boost { namespace python { namespace detail { @@ -21,39 +23,16 @@ namespace boost { namespace python { namespace detail { // function pointer or function type, should produce a callable Python // object. -template -struct wrap_function_select -{ - template - static objects::function* execute(F f) - { - return make_function(f); - } -}; +template +inline PyObject* wrap_function_aux(F f, PyObject*) { return f; } -template<> -struct wrap_function_select -{ - template - static F execute(F f) - { - return f; - } -}; +template +inline PyObject* wrap_function_aux(F f, ...) { return make_function(f); } template PyObject* wrap_function(F f) { - return wrap_function_select< -# if 1 - type_traits::ice_not< - is_pointer::value -# else - type_traits::ice_or< - is_function::value - , is_member_function_pointer::value -# endif - >::value >::execute(f); + return wrap_function_aux(f, f); } }}} // namespace boost::python::detail