Function objects
Материал из cppreference.com
|
|
This page has been machine-translated from the English version of the wiki using Google Translate.
The translation may contain errors and awkward wording. Hover over text to see the original version. You can help to fix errors and improve the translation. For instructions click here. |
Объект' является функцией любого объекта, для которого оператор вызова функции определен. 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.
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.
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. (шаблон класса) |
| (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. (шаблон функции) |
| (C++11) |
исключение при вызове пустой 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. (класс) |
[править] Привязка
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.
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. (шаблон функции) |
| (C++11) |
указывает, что объект является 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. (шаблон класса) |
| (C++11) |
указывает, что объект является стандартным заполнителя или может быть использован как один 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. (шаблон класса) |
| Defined in namespace
std::placeholders | |
| (C++11) |
заполнители для несвязанных аргументы в 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. (константа) |
[править] Ссылка обертки
Ссылка оболочки позволяют ссылкой аргументы, которые будут храниться в копируемой функциональных объектов
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.
You can help to correct and verify the translation. Click here for instructions.
| (C++11) |
CopyConstructible и CopyAssignable ссылкой обертку 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. (шаблон класса) |
| (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. (шаблон функции) |
[править] Функция объектов
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.
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. (шаблон класса) | |
| Функция объект, реализующий 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. (шаблон класса) | |
| Функция объект, реализующий 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. (шаблон класса) | |
| Функция объект, реализующий 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. (шаблон класса) | |
| Функция объект, реализующий 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. (шаблон класса) | |
| Функция объект, реализующий -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. (шаблон класса) | |
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. (шаблон класса) | |
| Функция объект, реализующий 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. (шаблон класса) | |
| Функция объект, реализующий 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. (шаблон класса) | |
| Функция объект, реализующий 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. (шаблон класса) | |
| Функция объект, реализующий 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. (шаблон класса) | |
| Функция объект, реализующий 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. (шаблон класса) | |
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. (шаблон класса) | |
| Функция объект, реализующий 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. (шаблон класса) | |
| Функция объект, реализующий !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. (шаблон класса) | |
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. (шаблон класса) | |
| Функция объект, реализующий 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. (шаблон класса) | |
| Функция объект, реализующий 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. (шаблон класса) | |
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. (шаблон класса) | |
| Объект функции-оболочки возвращения дополнение к бинарным предикатом в ней хранится 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. (шаблон класса) | |
| создает пользовательский объект 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. (шаблон функции) | |
| создает пользовательский объект 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. (шаблон функции) | |
[править] Устарело в 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.
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. (шаблон класса) |
| (устарело) |
Адаптер-совместимых бинарной функции базового класса 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. (шаблон класса) |
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. (шаблон класса) |
| (устарело) (устарело) |
связывает один аргумент в бинарной функции 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. (шаблон функции) |
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. (шаблон класса) |
| (устарело) |
Адаптер-совместимая оболочка для указателя на бинарной функции 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. (шаблон класса) |
| (устарело) |
создает адаптер-совместимые функции объекта обертку от указателя на функцию 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. (шаблон функции) |
| (устарело) (устарело) (устарело) (устарело) |
оболочкой для указателя на нульарные функция, вызываемая с указателем на объект 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. (шаблон класса) |
| (устарело) |
создает обертку от указателя на функцию-член, вызываемая с указателем на объект 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. (шаблон функции) |
| (устарело) (устарело) (устарело) (устарело) |
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. (шаблон класса) |
| (устарело) |
создает обертку от указателя на функцию-член, вызываемая со ссылкой на объект 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. (шаблон функции) |