[libsigcplusplus] mem_functor: Remove now-unnecessary operator()(pointer).



commit 41a7c4f14b4ac42301a22fafc6fff13ff4c04bd7
Author: Murray Cumming <murrayc murrayc com>
Date:   Thu Mar 10 14:20:49 2016 +0100

    mem_functor: Remove now-unnecessary operator()(pointer).

 sigc++/functors/mem_fun.h |    9 ---------
 tests/test_mem_fun.cc     |   34 ++++++++--------------------------
 2 files changed, 8 insertions(+), 35 deletions(-)
---
diff --git a/sigc++/functors/mem_fun.h b/sigc++/functors/mem_fun.h
index fe6973f..f68a918 100644
--- a/sigc++/functors/mem_fun.h
+++ b/sigc++/functors/mem_fun.h
@@ -86,15 +86,6 @@ public:
   explicit mem_functor(function_type _A_func) : func_ptr_(_A_func) {}
 
   /** Execute the wrapped method operating on the passed instance.
-   * @param _A_obj Pointer to instance the method should operate on.
-   * @param _A_a... Argument to be passed on to the method.
-   * @return The return value of the method invocation.
-   */
-  decltype(auto)
-  operator()(obj_type_with_modifier* _A_obj, type_trait_take_t<T_arg>... _A_a) const
-    { return (_A_obj->*(this->func_ptr_))(_A_a...); }
-
-  /** Execute the wrapped method operating on the passed instance.
    * @param _A_obj Reference to instance the method should operate on.
    * @param _A_a... Argument to be passed on to the method.
    * @return The return value of the method invocation.
diff --git a/tests/test_mem_fun.cc b/tests/test_mem_fun.cc
index 2d8d3a3..2d49be3 100644
--- a/tests/test_mem_fun.cc
+++ b/tests/test_mem_fun.cc
@@ -67,65 +67,47 @@ int main(int argc, char* argv[])
 
   { /* test non-const */
     test t;
-    sigc::mem_fun(&test::foo)(t, 1);  // on reference
-    util->check_result(result_stream, "test::foo(short 1)");
-
-    sigc::mem_fun(&test::foo)(&t, 1); // on pointer
+    sigc::mem_fun(&test::foo)(t, 1);
     util->check_result(result_stream, "test::foo(short 1)");
   }
   { /* test const */
     test t;
     sigc::mem_fun(&test::foo_const)(t, 2);
     util->check_result(result_stream, "test::foo_const(int 2)");
-
-    sigc::mem_fun(&test::foo_const)(&t, 2);
-    util->check_result(result_stream, "test::foo_const(int 2)");
   }
   { /* test const with const object */
     const auto t = test();
     sigc::mem_fun(&test::foo_const)(t, 3);
     util->check_result(result_stream, "test::foo_const(int 3)");
-
-    sigc::mem_fun(&test::foo_const)(&t, 3);
-    util->check_result(result_stream, "test::foo_const(int 3)");
   }
   { /* test non-const volatile */
     test t;
-    sigc::mem_fun(&test::foo_volatile)(t, 4);  // on reference
-    util->check_result(result_stream, "test::foo_volatile(float 4)");
-
-    sigc::mem_fun(&test::foo_volatile)(&t, 4); // on pointer
+    sigc::mem_fun(&test::foo_volatile)(t, 4);
     util->check_result(result_stream, "test::foo_volatile(float 4)");
   }
   { /* test const volatile */
     test t;
-    sigc::mem_fun(&test::foo_const_volatile)(t, 5);  // on reference
-    util->check_result(result_stream, "test::foo_const_volatile(double 5)");
-
-    sigc::mem_fun(&test::foo_const_volatile)(&t, 5); // on pointer
+    sigc::mem_fun(&test::foo_const_volatile)(t, 5);
     util->check_result(result_stream, "test::foo_const_volatile(double 5)");
   }
   { /* test const volatile with const object */
     const auto t = test();
-    sigc::mem_fun(&test::foo_const_volatile)(t, 6);  // on reference
-    util->check_result(result_stream, "test::foo_const_volatile(double 6)");
-
-    sigc::mem_fun(&test::foo_const_volatile)(&t, 6); // on pointer
+    sigc::mem_fun(&test::foo_const_volatile)(t, 6);
     util->check_result(result_stream, "test::foo_const_volatile(double 6)");
   }
 #if ENABLE_TEST_OF_OVERLOADED_FUNCTIONS
   { /* test overloaded */
     test t;
-    sigc::mem_fun<char>(&test::foo_overloaded)(&t, 7);
+    sigc::mem_fun<char>(&test::foo_overloaded)(t, 7);
     util->check_result(result_stream, "test::foo_overloaded(char 7)");
 
-    sigc::mem_fun<short>(&test::foo_overloaded)(&t, 7);
+    sigc::mem_fun<short>(&test::foo_overloaded)(t, 7);
     util->check_result(result_stream, "test::foo_overloaded(short 7)");
 
-    //sigc::mem_fun(&test::foo_overloaded)(&t, 7);
+    //sigc::mem_fun(&test::foo_overloaded)(t, 7);
     //util->check_result(result_stream, "test::foo_overloaded(short 7)");
 
-    sigc::mem_fun(&test::foo_overloaded)(&t, 7, 8);
+    sigc::mem_fun(&test::foo_overloaded)(t, 7, 8);
     util->check_result(result_stream, "test::foo_overloaded(int 7, int 8)");
   }
 #endif


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