Skip to content

Commit 4d69aeb

Browse files
committed
mem_fun(): Deprecate mem_fun(pointer, func).
Leaving just mem_fun(reference, func). See bug #763215 The deprecated mem_fun() has been removed from libsigc+--3.0, so this is a chance to adapt code before switching to libsigc++-3.0.
1 parent c97f598 commit 4d69aeb

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

sigc++/functors/macros/mem_fun.h.m4

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,20 @@ public:
4545
*/
4646
explicit [$2]mem_functor$1(function_type _A_func) : func_ptr_(_A_func) {}
4747
48+
#ifndef SIGCXX_DISABLE_DEPRECATED
4849
/** Execute the wrapped method operating on the passed instance.
50+
*
51+
* @deprecated Please use the constructor that takes the object by reference
52+
* instead.
53+
*
4954
* @param _A_obj Pointer to instance the method should operate on.dnl
5055
FOR(1, $1,[
5156
* @param _A_a%1 Argument to be passed on to the method.])
5257
* @return The return value of the method invocation.
5358
*/
5459
T_return operator()(LIST($3 T_obj* _A_obj, LOOP(type_trait_take_t<T_arg%1> _A_a%1, $1))) const
5560
{ return (_A_obj->*(this->func_ptr_))(LOOP(_A_a%1, $1)); }
61+
#endif //SIGCXX_DISABLE_DEPRECATED
5662
5763
/** Execute the wrapped method operating on the passed instance.
5864
* @param _A_obj Reference to instance the method should operate on.dnl
@@ -89,14 +95,20 @@ class bound_[$2]mem_functor$1
8995
public:
9096
typedef typename base_type_::function_type function_type;
9197
98+
#ifndef SIGCXX_DISABLE_DEPRECATED
9299
/** Constructs a bound_[$2]mem_functor$1 object that wraps the passed method.
100+
*
101+
* @deprecated Please use the constructor that takes the object by reference
102+
* instead.
103+
*
93104
* @param _A_obj Pointer to instance the method will operate on.
94105
* @param _A_func Pointer to method will be invoked from operator()().
95106
*/
96107
bound_[$2]mem_functor$1($3 T_obj* _A_obj, function_type _A_func)
97108
: base_type_(_A_func),
98109
obj_(*_A_obj)
99110
{}
111+
#endif // SIGCXX_DISABLE_DEPRECATED
100112
101113
/** Constructs a bound_[$2]mem_functor$1 object that wraps the passed method.
102114
* @param _A_obj Reference to instance the method will operate on.
@@ -156,7 +168,11 @@ mem_fun[]ifelse($2,, $1)(T_return (T_obj::*_A_func)(LOOP(T_arg%1,$1)) $5)
156168
157169
])
158170
define([BOUND_MEM_FUN],[dnl
171+
#ifndef SIGCXX_DISABLE_DEPRECATED
159172
/** Creates a functor of type sigc::bound_[$3]mem_functor$1 which encapsulates a method and an object instance.
173+
*
174+
* @deprecated Please use the version that takes the object by reference instead.
175+
*
160176
* @param _A_obj Pointer to object instance the functor should operate on.
161177
* @param _A_func Pointer to method that should be wrapped.
162178
* @return Functor that executes @e _A_func on invokation.
@@ -167,6 +183,7 @@ template <LIST(LOOP(class T_arg%1, $1), class T_return, class T_obj, class T_obj
167183
inline bound_[$3]mem_functor$1<LIST(T_return, T_obj, LOOP(T_arg%1, $1))>
168184
mem_fun[]ifelse($2,, $1)(/*$4*/ T_obj* _A_obj, T_return (T_obj2::*_A_func)(LOOP(T_arg%1,$1)) $5)
169185
{ return bound_[$3]mem_functor$1<LIST(T_return, T_obj, LOOP(T_arg%1, $1))>(_A_obj, _A_func); }
186+
#endif //SIGCXX_DISABLE_DEPRECATED
170187
171188
/** Creates a functor of type sigc::bound_[$3]mem_functor$1 which encapsulates a method and an object instance.
172189
* @param _A_obj Reference to object instance the functor should operate on.

0 commit comments

Comments
 (0)