[libsigcplusplus/variadic_mem_fun3: 147/148] mem_fun.h.m4: Remove mem_functor and const_mem_functor.



commit 3c139b4c6dd31c4c054f0ae69afd8204a6408c78
Author: Murray Cumming <murrayc murrayc com>
Date:   Sun Mar 6 21:12:02 2016 +0100

    mem_fun.h.m4: Remove mem_functor and const_mem_functor.
    
    They were only used in one place, internally, and did not add much clarity.

 sigc++/functors/functor_trait.h     |    8 ++++++--
 sigc++/functors/macros/mem_fun.h.m4 |   23 -----------------------
 tests/test_size.cc                  |    4 ++--
 3 files changed, 8 insertions(+), 27 deletions(-)
---
diff --git a/sigc++/functors/functor_trait.h b/sigc++/functors/functor_trait.h
index 62dc9e6..366d68c 100644
--- a/sigc++/functors/functor_trait.h
+++ b/sigc++/functors/functor_trait.h
@@ -208,14 +208,18 @@ template <class T_return, class T_obj, class... T_arg>
 struct functor_trait<T_return (T_obj::*)(T_arg...), false, false>
 {
   using result_type = T_return;
-  using functor_type = mem_functor<T_return, T_obj, T_arg...>;
+  using functor_type = mem_functor_base<
+    T_return (T_obj::*)(T_arg...),
+    T_arg...>;
 };
 
 template <class T_return, class T_obj, class... T_arg>
 struct functor_trait<T_return (T_obj::*)(T_arg...) const, false, false>
 {
   using result_type = T_return;
-  using functor_type = const_mem_functor<T_return, T_obj, T_arg...>;
+  using functor_type = mem_functor_base<
+    T_return (T_obj::*)(T_arg...) const,
+    T_arg...>;
 };
 
 #endif // DOXYGEN_SHOULD_SKIP_THIS
diff --git a/sigc++/functors/macros/mem_fun.h.m4 b/sigc++/functors/macros/mem_fun.h.m4
index 67c9d2d..ced7021 100644
--- a/sigc++/functors/macros/mem_fun.h.m4
+++ b/sigc++/functors/macros/mem_fun.h.m4
@@ -18,24 +18,6 @@ divert(-1)
 
 include(template.macros.m4)
 
-define([MEMBER_FUNCTOR],[dnl
-/** [$1]mem_functor wraps $2 methods with argument(s).
- * Use the convenience function mem_fun() to create an instance of [$1]mem_functor.
- *
- * The following template arguments are used:
- * - @e T_arg... Argument types used in the definition of operator()().
- * - @e T_return The return type of operator()().
- * - @e T_obj The object type.
- *
- * @ingroup mem_fun
- */
-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_arg...>;
-])
-
 define([MEM_FUN],[dnl
 /** Creates a functor of type sigc::[$1]mem_functor which wraps a $3 method.
  * @param _A_func Pointer to method that should be wrapped.
@@ -195,11 +177,6 @@ protected:
   function_type func_ptr_;
 };
 
-//mem_functor and const_mem_functor are just convenience aliases used in the
-//definition of functor_trait<> specializations. TODO: Remove them?
-
-MEMBER_FUNCTOR([],[])
-MEMBER_FUNCTOR([const_],[const])
 
 template <class T_func,
   class... T_arg>
diff --git a/tests/test_size.cc b/tests/test_size.cc
index 7bdca1a..b05c369 100644
--- a/tests/test_size.cc
+++ b/tests/test_size.cc
@@ -44,8 +44,8 @@ int main(int argc, char* argv[])
     std::cout << "  trackable_callback_list: " << sizeof(sigc::internal::trackable_callback_list) << 
std::endl;
     std::cout << "  slot_rep:                " << sizeof(sigc::internal::slot_rep) << std::endl;
     std::cout << "  typed_slot_rep<mem_functor<void,A> >: "
-              << sizeof(sigc::internal::typed_slot_rep<sigc::mem_functor<void,A> >) << std::endl;
+              << sizeof(sigc::internal::typed_slot_rep<sigc::mem_functor_base<void (A::*)()> >) << std::endl;
     std::cout << "  signal_impl:             " << sizeof(sigc::internal::signal_impl) << std::endl;
   }
   return util->get_result_and_delete_instance() ? EXIT_SUCCESS : EXIT_FAILURE;
-}
+}
\ No newline at end of file


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]