std::pointer_to_unary_function
来自cppreference.com
< cpp | utility | functional
工具库
函数对象
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
旧绑定器与适配器 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
template<
class
Arg, |
(C++11 中弃用) (C++17 中移除) |
|
std::pointer_to_unary_function
是表现为环绕一元函数的包装器的函数对象。
成员函数
(构造函数)
|
以提供的函数构造 pointer_to_unary_function 对象 (公开成员函数) |
operator()
|
调用存储的函数 (公开成员函数) |
std::pointer_to_unary_function::pointer_to_unary_function
explicit
pointer_to_unary_function(
Result (*f)(Arg)
);
|
||
构造 pointer_to_unary_function
函数对象,存储函数 f
。
参数
f | - | 要存储的指向函数指针 |
std::pointer_to_unary_function::operator()
Result
operator()(
Arg x )
const;
|
||
调用存储的函数。
参数
x | - | 传递给函数的参数 |
返回值
被调用函数的返回值。
参阅
(C++11
中弃用)(C++17
中移除)
|
适配器兼容的包装,用于包装二元函数的指针 (类模板) |
(C++11
中弃用)(C++17
中移除)
|
从函数指针创建与适配器兼容的函数对象包装器 (函数模板) |