diff options
author | Murray Cumming <murrayc@murrayc.com> | 2016-03-05 23:47:15 +0100 |
---|---|---|
committer | Murray Cumming <murrayc@murrayc.com> | 2016-03-06 00:02:10 +0100 |
commit | 084bd6bc6b6d7d770535681f1e1e92c6424061b4 (patch) | |
tree | 39a7d18f3c30af70ca670bca9757416815b04319 | |
parent | 83c6b74ca7ff669a522f0796d69e8b3f8f5ad515 (diff) | |
download | sigc++-084bd6bc6b6d7d770535681f1e1e92c6424061b4.tar.gz |
mem_functor_base: Remove T_obj template parameter.
Instead using member_method_class<>::type.
-rw-r--r-- | sigc++/adaptors/retype.h | 6 | ||||
-rw-r--r-- | sigc++/functors/macros/mem_fun.h.m4 | 16 |
2 files changed, 12 insertions, 10 deletions
diff --git a/sigc++/adaptors/retype.h b/sigc++/adaptors/retype.h index f3c4785..79d1bfa 100644 --- a/sigc++/adaptors/retype.h +++ b/sigc++/adaptors/retype.h @@ -137,10 +137,10 @@ retype(const pointer_functor<T_return, T_arg...>& _A_functor) * * @ingroup retype */ -template <class T_func, class T_obj, class... T_arg> +template <class T_func, class... T_arg> inline decltype(auto) -retype(const mem_functor_base<T_func, T_obj, T_arg...>& _A_functor) -{ return retype_functor<mem_functor_base<T_func, T_obj, T_arg...>, T_arg...> +retype(const mem_functor_base<T_func, T_arg...>& _A_functor) +{ return retype_functor<mem_functor_base<T_func, T_arg...>, T_arg...> (_A_functor); } diff --git a/sigc++/functors/macros/mem_fun.h.m4 b/sigc++/functors/macros/mem_fun.h.m4 index 3be8be5..2db3ae3 100644 --- a/sigc++/functors/macros/mem_fun.h.m4 +++ b/sigc++/functors/macros/mem_fun.h.m4 @@ -33,7 +33,7 @@ template<class T_return, class T_obj, class... T_arg> using [$1]mem_functor = mem_functor_base< T_return (T_obj::*)(T_arg...) $2, - T_obj, T_arg...>; + T_arg...>; ]) define([BOUND_MEMBER_FUNCTOR],[dnl @@ -67,7 +67,7 @@ inline decltype(auto) mem_fun(T_return (T_obj::*_A_func)(T_arg...) $3) { return mem_functor_base< T_return (T_obj::*)(T_arg...) $3, - T_obj, T_arg...>(_A_func); } + T_arg...>(_A_func); } ]) define([BOUND_MEM_FUN],[dnl @@ -168,15 +168,17 @@ namespace sigc { * @ingroup sigcfunctors */ -template <class T_func, class T_obj, class... T_arg> +template <class T_func, class... T_arg> class mem_functor_base : public functor_base { public: + using object_type = typename member_method_class<T_func>::type; + using function_type = T_func; - using result_type = std::result_of_t<T_func(T_obj*, T_arg...)>; + using result_type = std::result_of_t<T_func(object_type*, T_arg...)>; using obj_type_with_modifier = typename std::conditional_t< - member_method_is_const<T_func>::value, const T_obj, T_obj>; + member_method_is_const<T_func>::value, const object_type, object_type>; /// Constructs an invalid functor. mem_functor_base() : func_ptr_(nullptr) {} @@ -217,9 +219,9 @@ MEMBER_FUNCTOR([const_],[const]) template <class T_func, class T_obj, class... T_arg> class bound_mem_functor_base -: mem_functor_base<T_func, T_obj, T_arg...> +: mem_functor_base<T_func, T_arg...> { - using base_type = mem_functor_base<T_func, T_obj, T_arg...>; + using base_type = mem_functor_base<T_func, T_arg...>; public: using function_type = typename base_type::function_type; using result_type = typename base_type::result_type; |