Imported Upstream version 2.99.2
[platform/upstream/libsigc++.git] / sigc++ / functors / mem_fun.h
index 25358dc..5caac6b 100644 (file)
@@ -31,7 +31,7 @@ namespace sigc {
  *   void bar(int) {}
  * };
  * foo my_foo;
- * sigc::slot<void, int> sl = sigc::mem_fun(my_foo, &foo::bar);
+ * sigc::slot<void(int)> sl = sigc::mem_fun(my_foo, &foo::bar);
  * // Note: f is not a slot. It will not be invalidated when my_foo is deleted.
  * auto f = sigc::mem_fun(my_foo, &foo::bar); // Usually not what you want.
  * @endcode
@@ -45,7 +45,7 @@ namespace sigc {
  *   void bar(int) const {}
  * };
  * const foo my_foo;
- * sigc::slot<void, int> sl = sigc::mem_fun(my_foo, &foo::bar);
+ * sigc::slot<void(int)> sl = sigc::mem_fun(my_foo, &foo::bar);
  * @endcode
  *
  * Use mem_fun#() if there is an ambiguity as to the number of arguments.
@@ -59,7 +59,7 @@ namespace sigc {
  *   void bar(int, int) {}
  * };
  * foo my_foo;
- * sigc::slot<void, int> sl = sigc::mem_fun1<int>(my_foo, &foo::bar);
+ * sigc::slot<void(int)> sl = sigc::mem_fun1<int>(my_foo, &foo::bar);
  * @endcode
  *
  * @ingroup sigcfunctors
@@ -69,13 +69,13 @@ template <class T_func, class... T_arg>
 class mem_functor : public functor_base
 {
 public:
-  using object_type = typename member_method_class<T_func>::type;
+  using object_type = typename internal::member_method_class<T_func>::type;
 
   using function_type = T_func;
-  using result_type = typename member_method_result<T_func>::type;
+  using result_type = typename internal::member_method_result<T_func>::type;
 
   using obj_type_with_modifier = typename std::conditional_t<
-    member_method_is_const<T_func>::value, const object_type, object_type>;
+    internal::member_method_is_const<T_func>::value, const object_type, object_type>;
 
   /// Constructs an invalid functor.
   mem_functor() : func_ptr_(nullptr) {}
@@ -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.
@@ -121,9 +112,9 @@ public:
   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 object_type, object_type>;
+    internal::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,
+    internal::member_method_is_const<T_func>::value,
       limit_reference<const object_type>, limit_reference<object_type>>;
 
   /** Constructs a bound_mem_functor object that wraps the passed method.
@@ -227,23 +218,6 @@ mem_fun(T_return (T_obj::*_A_func)(T_arg...) const volatile)
     T_arg...>(_A_func); }
 
 
-
-/** Creates a functor of type sigc::bound_mem_functor which encapsulates a method and an object instance.
- * @param _A_obj Pointer to object instance the functor should operate on.
- * @param _A_func Pointer to method that should be wrapped.
- * @return Functor that executes @e _A_func on invokation.
- *
- * @ingroup mem_fun
- */
-template <class T_return, class T_obj, class T_obj2, class... T_arg>
-inline decltype(auto)
-mem_fun(/**/ T_obj* _A_obj, T_return (T_obj2::*_A_func)(T_arg...) )
-{
-  return bound_mem_functor<
-    T_return (T_obj::*)(T_arg...) ,
-    T_arg...>(*_A_obj, _A_func);
-}
-
 /** Creates a functor of type sigc::bound_mem_functor which encapsulates a method and an object instance.
  * @param _A_obj Reference to object instance the functor should operate on.
  * @param _A_func Pointer to method that should be wrapped.
@@ -260,23 +234,6 @@ mem_fun(/**/ T_obj& _A_obj, T_return (T_obj2::*_A_func)(T_arg...) )
     T_arg...>(_A_obj, _A_func);
 }
 
-
-/** Creates a functor of type sigc::bound_const_mem_functor which encapsulates a method and an object instance.
- * @param _A_obj Pointer to object instance the functor should operate on.
- * @param _A_func Pointer to method that should be wrapped.
- * @return Functor that executes @e _A_func on invokation.
- *
- * @ingroup mem_fun
- */
-template <class T_return, class T_obj, class T_obj2, class... T_arg>
-inline decltype(auto)
-mem_fun(/*const*/ T_obj* _A_obj, T_return (T_obj2::*_A_func)(T_arg...) const)
-{
-  return bound_mem_functor<
-    T_return (T_obj::*)(T_arg...) const,
-    T_arg...>(*_A_obj, _A_func);
-}
-
 /** Creates a functor of type sigc::bound_const_mem_functor which encapsulates a method and an object instance.
  * @param _A_obj Reference to object instance the functor should operate on.
  * @param _A_func Pointer to method that should be wrapped.
@@ -295,22 +252,6 @@ mem_fun(/*const*/ T_obj& _A_obj, T_return (T_obj2::*_A_func)(T_arg...) const)
 
 
 /** Creates a functor of type sigc::bound_volatile_mem_functor which encapsulates a method and an object instance.
- * @param _A_obj Pointer to object instance the functor should operate on.
- * @param _A_func Pointer to method that should be wrapped.
- * @return Functor that executes @e _A_func on invokation.
- *
- * @ingroup mem_fun
- */
-template <class T_return, class T_obj, class T_obj2, class... T_arg>
-inline decltype(auto)
-mem_fun(/**/ T_obj* _A_obj, T_return (T_obj2::*_A_func)(T_arg...) volatile)
-{
-  return bound_mem_functor<
-    T_return (T_obj::*)(T_arg...) volatile,
-    T_arg...>(*_A_obj, _A_func);
-}
-
-/** Creates a functor of type sigc::bound_volatile_mem_functor which encapsulates a method and an object instance.
  * @param _A_obj Reference to object instance the functor should operate on.
  * @param _A_func Pointer to method that should be wrapped.
  * @return Functor that executes @e _A_func on invokation.
@@ -328,22 +269,6 @@ mem_fun(/**/ T_obj& _A_obj, T_return (T_obj2::*_A_func)(T_arg...) volatile)
 
 
 /** Creates a functor of type sigc::bound_const_volatile_mem_functor which encapsulates a method and an object instance.
- * @param _A_obj Pointer to object instance the functor should operate on.
- * @param _A_func Pointer to method that should be wrapped.
- * @return Functor that executes @e _A_func on invokation.
- *
- * @ingroup mem_fun
- */
-template <class T_return, class T_obj, class T_obj2, class... T_arg>
-inline decltype(auto)
-mem_fun(/*const*/ T_obj* _A_obj, T_return (T_obj2::*_A_func)(T_arg...) const volatile)
-{
-  return bound_mem_functor<
-    T_return (T_obj::*)(T_arg...) const volatile,
-    T_arg...>(*_A_obj, _A_func);
-}
-
-/** Creates a functor of type sigc::bound_const_volatile_mem_functor which encapsulates a method and an object instance.
  * @param _A_obj Reference to object instance the functor should operate on.
  * @param _A_func Pointer to method that should be wrapped.
  * @return Functor that executes @e _A_func on invokation.