[libsigcplusplus/variadic_mem_fun3: 142/148] bound_mem_functor_base: Remove now-unnecessary T_obj template parameter.
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libsigcplusplus/variadic_mem_fun3: 142/148] bound_mem_functor_base: Remove now-unnecessary T_obj template parameter.
- Date: Mon, 7 Mar 2016 10:09:45 +0000 (UTC)
commit e683fac5b349a2bf3e6a2494d6890e219963e767
Author: Murray Cumming <murrayc murrayc com>
Date: Sat Mar 5 23:51:51 2016 +0100
bound_mem_functor_base: Remove now-unnecessary T_obj template parameter.
sigc++/adaptors/retype.h | 6 +++---
sigc++/functors/macros/mem_fun.h.m4 | 20 +++++++++++---------
2 files changed, 14 insertions(+), 12 deletions(-)
---
diff --git a/sigc++/adaptors/retype.h b/sigc++/adaptors/retype.h
index 621ceef..db3be85 100644
--- a/sigc++/adaptors/retype.h
+++ b/sigc++/adaptors/retype.h
@@ -154,10 +154,10 @@ retype(const mem_functor_base<T_func, T_arg...>& _A_functor)
*/
template <
class T_func,
- class T_obj, class... T_arg>
+ class... T_arg>
inline decltype(auto)
-retype(const bound_mem_functor_base<T_func, T_obj, T_arg...>& _A_functor)
-{ return retype_functor<bound_mem_functor_base<T_func, T_obj, T_arg...>, T_arg...>
+retype(const bound_mem_functor_base<T_func, T_arg...>& _A_functor)
+{ return retype_functor<bound_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 d8e1b37..f78f47c 100644
--- a/sigc++/functors/macros/mem_fun.h.m4
+++ b/sigc++/functors/macros/mem_fun.h.m4
@@ -52,7 +52,7 @@ template<class T_return, class T_obj, class... T_arg>
using bound_[$1]mem_functor =
bound_mem_functor_base<
T_return (T_obj::*)(T_arg...) $2,
- T_obj, T_arg...>;
+ T_arg...>;
])
define([MEM_FUN],[dnl
@@ -84,7 +84,7 @@ mem_fun(/*$2*/ T_obj* _A_obj, T_return (T_obj2::*_A_func)(T_arg...) $3)
{
return bound_mem_functor_base<
T_return (T_obj::*)(T_arg...) $3,
- T_obj, T_arg...>(_A_obj, _A_func);
+ T_arg...>(_A_obj, _A_func);
}
/** Creates a functor of type sigc::bound_[$1]mem_functor which encapsulates a method and an object instance.
@@ -100,7 +100,7 @@ mem_fun(/*$2*/ T_obj& _A_obj, T_return (T_obj2::*_A_func)(T_arg...) $3)
{
return bound_mem_functor_base<
T_return (T_obj::*)(T_arg...) $3,
- T_obj, T_arg...>(_A_obj, _A_func);
+ T_arg...>(_A_obj, _A_func);
}
])
@@ -221,7 +221,7 @@ MEMBER_FUNCTOR([],[])
MEMBER_FUNCTOR([const_],[const])
template <class T_func,
- class T_obj, class... T_arg>
+ class... T_arg>
class bound_mem_functor_base
: mem_functor_base<T_func, T_arg...>
{
@@ -230,11 +230,13 @@ public:
using function_type = typename base_type::function_type;
using result_type = typename base_type::result_type;
+ using object_type = typename base_type::object_type;
+
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>;
using T_limit_reference = typename std::conditional_t<
member_method_is_const<T_func>::value,
- limit_reference<const T_obj>, limit_reference<T_obj>>;
+ limit_reference<const object_type>, limit_reference<object_type>>;
/** Constructs a bound_mem_functor_base object that wraps the passed method.
* @param _A_obj Pointer to instance the method will operate on.
@@ -277,12 +279,12 @@ public:
*
* @ingroup mem_fun
*/
-template <class T_func, class T_obj, class... T_arg>
-struct visitor<bound_mem_functor_base<T_func, T_obj, T_arg...> >
+template <class T_func, class... T_arg>
+struct visitor<bound_mem_functor_base<T_func, T_arg...> >
{
template <class T_action>
static void do_visit_each(const T_action& _A_action,
- const bound_mem_functor_base<T_func, T_obj, T_arg...>& _A_target)
+ const bound_mem_functor_base<T_func, T_arg...>& _A_target)
{
sigc::visit_each(_A_action, _A_target.obj_);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]