[libsigc++2/variadic_mem_fun2] bound_mem_functor_base: Remove now-unnecessary T_obj template parameter.



commit c888651a34b52494ea9b0a3010fbcdbb73b2bfdd
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 79d1bfa..66b7397 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 2db3ae3..89b9147 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);
 }
 
 ])
@@ -217,7 +217,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...>
 {
@@ -226,11 +226,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.
@@ -273,12 +275,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]