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

来自cppreference.com
< cpp‎ | utility‎ | functional
 
 
 
函数对象
函数调用
(C++17)(C++23)
恒等函数对象
(C++20)
通透运算符包装器
(C++14)
(C++14)
(C++14)
(C++14)  
(C++14)
(C++14)
(C++14)
(C++14)
(C++14)
(C++14)
(C++14)
(C++14)
(C++14)

旧式绑定器与适配器
(C++17 前*)
(C++17 前*)
(C++17 前*)
(C++17 前*)
(C++17 前*)(C++17 前*)(C++17 前*)(C++17 前*)
(C++20 前*)
(C++20 前*)
(C++17 前*)(C++17 前*)
(C++17 前*)(C++17 前*)

(C++17 前*)
mem_fun_ref_tmem_fun1_ref_tconst_mem_fun_ref_tconst_mem_fun1_ref_t
(C++17 前*)(C++17 前*)(C++17 前*)(C++17 前*)
(C++20 前*)
(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) 包装无形参的 const 成员函数。
3) 包装有单形参的非 const 成员函数。
4) 包装有单形参的 const 成员函数。

[编辑] 参阅

(C++11 弃用)(C++17 移除)
从成员函数指针创建包装器,可以一个对象引用调用
(函数模板) [编辑]
指向零元或一元成员函数指针的包装器,可以一个对象指针调用
(类模板) [编辑]