Function objects

来自cppreference.com

 
 
实用工具库
类型的支持 (basic types, RTTI, type traits)
动态内存管理
错误处理
程序实用工具
可变参数函数
日期和时间
函数对象
initializer_list(C++11)
bitset
hash(C++11)
关系运算符
Original:
Relational operators
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
rel_ops::operator!=
rel_ops::operator>
rel_ops::operator<=
rel_ops::operator>=
双和元组
Original:
Pairs and tuples
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
pair
tuple(C++11)
piecewise_construct_t(C++11)
piecewise_construct(C++11)
掉期,远期和移动
Original:
Swap, forward and move
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
swap
forward(C++11)
move(C++11)
move_if_noexcept(C++11)
declval(C++11)
 
函数对象
功能包装
Original:
Function wrappers
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
function(C++11)
mem_fn(C++11)
bad_function_call(C++11)
绑定
Original:
Bind
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
bind(C++11)
is_bind_expression(C++11)
is_placeholder(C++11)
_1, _2, _3, ...(C++11)
参考包装
Original:
Reference wrappers
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
reference_wrapper(C++11)
ref
cref
(C++11)
(C++11)
操作包装
Original:
Operator wrappers
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
否定词
Original:
Negators
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
已过时粘合剂和适配器
Original:
Deprecated binders and adaptors
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
unary_function(过时了)
binary_function(过时了)
ptr_fun(过时了)
pointer_to_unary_function(过时了)
pointer_to_binary_function(过时了)
mem_fun(过时了)
mem_fun_t
mem_fun1_t
const_mem_fun_t
const_mem_fun1_t
(过时了)
(过时了)
(过时了)
(过时了)
mem_fun_ref(过时了)
mem_fun_ref_t
mem_fun1_ref_t
const_mem_fun_ref_t
const_mem_fun1_ref_t
(过时了)
(过时了)
(过时了)
(过时了)
binder1st
binder2nd
(过时了)
(过时了)
bind1st
bind2nd
(过时了)
(过时了)
 
A“函数对象”的函数调用操作符的定义是任何对象。 C + +提供了许多内置的函数对象,以及支持新的函数对象的创建和操纵的.....
Original:
A function object is any object for which the function call operator is defined. C++ provides many built-in function objects as well as support for creation and manipulation of new function objects.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

目录

[编辑] 多态函数包装

std::function提供了用于存储任意的函数对象的支持.
Original:
std::function provides support for storing arbitrary function objects.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
(C++11)
包装任何类型的可调用对象与指定的函数调用签名
Original:
wraps callable object of any type with specified function call signature
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类模板) [edit]
(C++11)
创建一个函数对象的指针的成员
Original:
creates a function object out of a pointer to a member
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(函数模板) [edit]
调用一个空的std::function时抛出的异常
Original:
the exception thrown when invoking an empty std::function
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类) [edit]

[编辑] 绑定

std::bind提供支持部分功能的应用,即绑定函数的参数,以产生新的功能.
Original:
std::bind provides support for 部分功能的应用, i.e. binding arguments to functions to produce new functions.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
(C++11)
绑定一个或多个参数的函数对象
Original:
binds one or more arguments to a function object
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(函数模板) [edit]
指示一个对象是std::bind表达或者可以用作一个
Original:
indicates that an object is std::bind expression or can be used as one
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类模板) [edit]
(C++11)
指示一个对象是一个标准的占位符或可以用作1
Original:
indicates that an object is a standard placeholder or can be used as one
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类模板) [edit]
Defined in namespace std::placeholders
std::bind表达在未绑定的参数的占位符
Original:
placeholders for the unbound arguments in a std::bind expression
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(不变) [edit]

[编辑] 参考包装

参考包装使存储在复制的函数对象的引用参数
Original:
Reference wrappers allow reference arguments to be stored in copyable function objects:
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
CopyConstructibleCopyAssignable参考包装
Original:
CopyConstructible and CopyAssignable reference wrapper
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类模板) [edit]
(C++11)
(C++11)
创建一个std::reference_wrapper推导出它的参数类型
Original:
creates a std::reference_wrapper with a type deduced from its argument
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(函数模板) [edit]

[编辑] 函数对象

C + +函数对象定义了几个常见的算术和逻辑运算
Original:
C++ defines several function objects that represent common arithmetic and logical operations:
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
算术运算
Original:
Arithmetic operations
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
函数对象实施x + y
Original:
function object implementing x + y
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类模板) [edit]
函数对象实施x - y
Original:
function object implementing x - y
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类模板) [edit]
函数对象实施x * y
Original:
function object implementing x * y
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类模板) [edit]
函数对象实施x / y
Original:
function object implementing x / y
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类模板) [edit]
函数对象实施x % y
Original:
function object implementing x % y
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类模板) [edit]
函数对象实施-x
Original:
function object implementing -x
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类模板) [edit]
比较
Original:
Comparisons
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
函数对象实施x == y
Original:
function object implementing x == y
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类模板) [edit]
函数对象实施x != y
Original:
function object implementing x != y
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类模板) [edit]
函数对象实施x > y
Original:
function object implementing x > y
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类模板) [edit]
函数对象实施x < y
Original:
function object implementing x < y
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类模板) [edit]
函数对象实施x >= y
Original:
function object implementing x >= y
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类模板) [edit]
函数对象实施x <= y
Original:
function object implementing x <= y
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类模板) [edit]
逻辑运算
Original:
Logical operations
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
函数对象实施x && y
Original:
function object implementing x && y
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类模板) [edit]
函数对象实施x || y
Original:
function object implementing x || y
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类模板) [edit]
函数对象实施!x
Original:
function object implementing !x
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类模板) [edit]
位运算
Original:
Bitwise operations
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
函数对象实施x & y
Original:
function object implementing x & y
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类模板) [edit]
函数对象实施x | y
Original:
function object implementing x | y
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类模板) [edit]
函数对象实施x ^ y
Original:
function object implementing x ^ y
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类模板) [edit]
否定词
Original:
Negators
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
包装函数对象返回的补一元谓词其持有的
Original:
wrapper function object returning the complement of the unary predicate it holds
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类模板) [edit]
包装函数对象返回的补其所持有的二元谓词
Original:
wrapper function object returning the complement of the binary predicate it holds
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类模板) [edit]
构造自定义std::unary_negate对象
Original:
constructs custom std::unary_negate object
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(函数模板) [edit]
构造自定义std::binary_negate对象
Original:
constructs custom std::binary_negate object
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(函数模板) [edit]

[编辑] 不推荐在C + +11

已被弃用的几个实用工具,提供了早期功能支持在C + +11
Original:
Several utilities that provided early functional support are deprecated in C++11:
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
基地
Original:
Base
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
(过时了)
适配器兼容的一元函数的基类
Original:
adaptor-compatible unary function base class
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类模板) [edit]
(过时了)
适配器兼容的二元函数的基类
Original:
adaptor-compatible binary function base class
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类模板) [edit]
粘合剂
Original:
Binders
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
(过时了)
(过时了)
函数对象的一个​​二元函数和它的参数之一
Original:
function object holding a binary function and one of its arguments
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类模板) [edit]
(过时了)
(过时了)
一个参数绑定到一个二元函数
Original:
binds one argument to a binary function
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(函数模板) [edit]
功能的适配器
Original:
Function adaptors
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
适配器兼容的包装,一元函数的指针
Original:
adaptor-compatible wrapper for a pointer to unary function
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类模板) [edit]
适配器兼容的封装为一个二元函数的指针
Original:
adaptor-compatible wrapper for a pointer to binary function
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类模板) [edit]
(过时了)
创建适配器兼容功能的包装对象从一个指针到函数
Original:
creates an adaptor-compatible function object wrapper from a pointer to function
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(函数模板) [edit]
(过时了)
(过时了)
(过时了)
(过时了)
包装为一个无参的成员函数,调用一个指向对象的指针的指针
Original:
wrapper for a pointer to nullary member function, callable with a pointer to object
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类模板) [edit]
(过时了)
从一个指针成员函数创建一个包装,一个指向对象的指针调用
Original:
creates a wrapper from a pointer to member function, callable with a pointer to object
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(函数模板) [edit]
(过时了)
(过时了)
(过时了)
(过时了)
wapper一个无参或一元成员函数的指针,调用的参考对象
Original:
wapper for a pointer to nullary or unary member function, callable with a reference to object
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类模板) [edit]
(过时了)
从一个指针成员函数创建一个包装,赎回的参考对象
Original:
creates a wrapper from a pointer to member function, callable with a reference to object
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(函数模板) [edit]