首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

std::const_mem_fun1_t

template< class S, class T > class mem_fun_t : public unary_function<T*,S> { public: explicit mem_fun_t(S (T::*p)()); S operator()(T* p) const; };

(1)

(until C++17)(deprecated since C++11)

template< class S, class T > class const_mem_fun_t : public unary_function<const T*,S> { public: explicit const_mem_fun_t(S (T::*p)() const); S operator()(const T* p) const; };

(2)

(until C++17)(deprecated since C++11)

template< class S, class T, class Arg > class mem_fun1_t : public binary_function<T*,A,S> { public: explicit mem_fun1_t(S (T::*p)(A)); S operator()(T* p, A x) const; };

(3)

(until C++17)(deprecated since C++11)

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

(4)

(until C++17)(deprecated since C++11)

成员函数指针的包装器。调用其成员函数的类实例作为指向operator()...

1%29封装一个不含参数的非Const成员函数.

2%29封装不带参数的Const成员函数。

3%29用一个参数包装一个非Const成员函数。

4%29用一个参数包装一个Const成员函数。

另见

mem_fun (until C++17)

creates a wrapper from a pointer to member function, callable with a pointer to object (function template)

mem_fun_ref_tmem_fun1_ref_tconst_mem_fun_ref_tconst_mem_fun1_ref_t (until C++17)(until C++17)(until C++17)(until C++17)

wrapper for a pointer to nullary or unary member function, callable with a reference to object (class template)

代码语言:txt
复制
 © cppreference.com

在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。

扫码关注腾讯云开发者

领取腾讯云代金券