类型mem_fun_t或mem_fun1_tconst或non_const函数对象。
mem_fun_t 类 mem_fun1_ref_t 类 mem_fun1_t 类 minus 结构 modulus 结构 multiplies 结构 negate 结构 not_equal_to struct plus 结构 pointer_to_binary_function 类 pointer_to_unary_function 类 reference_wrapper 类 unary_function 结构 unary_negate 类 ...
template<class Result, class Type, class Arg> class mem_fun1_t : public binary_function<Type *, Arg, Result> { explicit mem_fun1_t( Result (Type::* _Pm )( Arg ) ); Result operator()( Type* _Pleft, Arg _Right ) const; }; 参数...
intn = std::mem_fun_ref(&A::test)(a); 27 intn2 = std::mem_fun1_ref(&A::add)(a,100); 28 29 printf("%d\n", n);//10 30 printf("%d\n", n2);//110 31 } 分析 接着看看functional的源代码,分析是怎么实现的执行std::mem_fun_ref(&A::test)(a)时,首先执行这个函数 23 templ...
//#define mem_fun1 mem_fun #include <iostream> #include <vector> #include <string> #include <algorithm> #include <functional> class Person { private: std::string name; public: //... void print () const { std::cout << name << std::endl; } void printWithPrefix (std::string ...
mem_fun1Copy template<class R, class T, class A> mem_fun1_t<R, T, A> mem_fun1(R (T::*pm)(A)); The template function returns mem_fun1_t<R, T, A>(pm).English (United States) Your Privacy Choices Theme Manage cookies Previous Versions Blog Contribute Privacy Terms of Use ...
範例 通常不會直接使用const_mem_fun1_t建構函式;Helper 函式mem_fun用來符合成員函式。的範例參閱mem_fun使用成員函式配置器。 需求 標題:<functional> 命名空間:std 請參閱 參考 在標準 C++ 程式庫中的執行緒安全 標準樣板程式庫
template<class Result, class Type, class Arg> class mem_fun1_t : public binary_function<Type *, Arg, Result> { explicit mem_fun1_t( Result (Type::* _Pm )( Arg ) ); Result operator()( Type* _Pleft, Arg _Right ) const; }; Parâmetros...
_1 Object bad_function_call Class binary_function Struct binary_negate Class bind Function bind1st Function bind2nd Function binder1st Class binder2nd Class bit_and Function bit_or Function bit_xor Function const_mem_fun_ref_t Class const_mem_fun_t Class const_mem_fun1_ref_t Class const_mem...
std::mem_fun1_ref_t 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) (until C++17)(deprecated since C++11) template< class S, class T > class const_mem_...