Namespaces
Variants

std:: mem_fun_ref_t, std:: mem_fun1_ref_t, std:: const_mem_fun_ref_t, std:: const_mem_fun1_ref_t

From cppreference.net
Utilities library
Function objects
Function invocation
(C++17) (C++23)
Identity function object
(C++20)
Old binders and adaptors
( until C++17* )
( until C++17* )
( until C++17* )
( until C++17* )
( until C++17* ) ( until C++17* ) ( until C++17* ) ( until C++17* )
( until C++20* )
( until C++20* )
( until C++17* ) ( until C++17* )
( until C++17* ) ( until C++17* )

( until C++17* )
mem_fun_ref_t mem_fun1_ref_t const_mem_fun_ref_t const_mem_fun1_ref_t
( until C++17* ) ( until C++17* ) ( until C++17* ) ( until C++17* )
( until C++20* )
( until C++20* )
定义于头文件 <functional>
template < class S, class T >

class mem_fun_ref_t : public unary_function < T,S > {
public :
explicit mem_fun_ref_t ( S ( T :: * p ) ( ) ) ;
S operator ( ) ( T & p ) const ;

} ;
(1) (C++11 中弃用)
(C++17 中移除)
template < class S, class T >

class const_mem_fun_ref_t : public unary_function < T,S > {
public :
explicit const_mem_fun_ref_t ( S ( T :: * p ) ( ) const ) ;
S operator ( ) ( const T & p ) const ;

} ;
(2) (C++11 中弃用)
(C++17 中移除)
template < class S, class T, class A >

class mem_fun1_ref_t : public binary_function < T,A,S > {
public :
explicit mem_fun1_ref_t ( S ( T :: * p ) ( A ) ) ;
S operator ( ) ( T & p, A x ) const ;

} ;
(3) (C++11 中弃用)
(C++17 中移除)
template < class S, class T, class A >

class const_mem_fun1_ref_t : public binary_function < T,A,S > {
public :
explicit const_mem_fun1_ref_t ( S ( T :: * p ) ( A ) const ) ;
S operator ( ) ( const T & p, A x ) const ;

} ;
(4) (C++11 中弃用)
(C++17 中移除)

围绕成员函数指针的包装器。调用成员函数的类实例以引用形式传递给 operator()

1) 封装一个无参数的非const成员函数。
2) 封装一个无参数的常量成员函数。
3) 包装具有单个参数的非const成员函数。
4) 包装具有单个参数的常量成员函数。

另请参阅

(C++11 中弃用) (C++17 中移除)
创建成员函数指针的包装器,可通过对象引用调用
(函数模板)
空元或一元成员函数指针的包装器,可通过对象指针调用
(类模板)