Function objects
Da 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. |
A' objeto de função é qualquer objeto para o qual o operador de chamada de função é definida. C + + fornece muitos objetos internos de função, bem como suporte para a criação e manipulação de objetos nova função.
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.
[editar] Polimórficos invólucros de função
std::function fornece suporte para armazenar objetos de função arbitrárias.
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) |
envolve objeto que pode ser chamado de qualquer tipo com a assinatura especificada função chamada 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. (modelo de classe) |
(C++11) |
cria um objecto de função de um apontador para um membro 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. (modelo de função) |
(C++11) |
a exceção lançada quando invocar um std::function vazio 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. (classe) |
[editar] Ligar
std::bind fornece suporte para aplicação de função parcial, ou seja, os argumentos de ligação para as funções de produzir novas funções.
Original:
std::bind provides support for aplicação de função parcial, 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) |
se liga um ou mais argumentos para um objeto de função 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. (modelo de função) |
(C++11) |
indica que um objecto é expressão std::bind ou podem ser utilizados como um 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. (modelo de classe) |
(C++11) |
indica que um objecto é um marcador padrão ou podem ser utilizados como um 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. (modelo de classe) |
Defined in namespace
std::placeholders | |
(C++11) |
espaços reservados para os argumentos não ligados em uma expressão de 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. (constante) |
[editar] Invólucros de referência
Invólucros de referência permitir argumentos de referência para ser armazenado em objetos de função copiáveis:
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 e CopyAssignable invólucro de referência 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. (modelo de classe) |
(C++11) (C++11) |
cria um std::reference_wrapper com um tipo de deduzir o seu argumento 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. (modelo de função) |
[editar] Objetos de função
C + + define objetos que representam várias funções aritmética comum e operações lógicas:
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. | |
objeto de função implementar 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. (modelo de classe) | |
objeto de função implementar 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. (modelo de classe) | |
objeto de função implementar 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. (modelo de classe) | |
objeto de função implementar 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. (modelo de classe) | |
objeto de função implementar 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. (modelo de classe) | |
objeto de função implementar -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. (modelo de classe) | |
Original: Comparisons The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
objeto de função implementar 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. (modelo de classe) | |
objeto de função implementar 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. (modelo de classe) | |
objeto de função implementar 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. (modelo de classe) | |
objeto de função implementar 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. (modelo de classe) | |
objeto de função implementar 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. (modelo de classe) | |
objeto de função implementar 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. (modelo de classe) | |
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. | |
objeto de função implementar 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. (modelo de classe) | |
objeto de função implementar 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. (modelo de classe) | |
objeto de função implementar !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. (modelo de classe) | |
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. | |
objeto de função implementar 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. (modelo de classe) | |
objeto de função implementar 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. (modelo de classe) | |
objeto de função implementar 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. (modelo de classe) | |
Original: Negators The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
objeto função wrapper retornando o complemento do predicado unário que detém 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. (modelo de classe) | |
objeto função wrapper retornando o complemento do predicado binário que detém 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. (modelo de classe) | |
constrói objeto std::unary_negate personalizado 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. (modelo de função) | |
constrói objeto std::binary_negate personalizado 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. (modelo de função) |
[editar] Depreciado em C + 11
Vários utilitários que forneceram suporte funcional precoce são preteridos em 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. | |
(obsoleta) |
adaptador compatível classe base unário função 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. (modelo de classe) |
(obsoleta) |
adaptador compatível binário classe base função 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. (modelo de classe) |
Original: Binders The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
(obsoleta) (obsoleta) |
objeto de função segurando uma função binária e um de seus argumentos 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. (modelo de classe) |
(obsoleta) (obsoleta) |
se liga um argumento de uma função binária 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. (modelo de função) |
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. | |
(obsoleta) |
adaptador compatível com invólucro para um ponteiro para função unário 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. (modelo de classe) |
(obsoleta) |
adaptador compatível com invólucro para um ponteiro para função de binário 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. (modelo de classe) |
(obsoleta) |
cria um adaptador compatível com invólucro objeto de função de um ponteiro para função 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. (modelo de função) |
(obsoleta) (obsoleta) (obsoleta) (obsoleta) |
wrapper para um ponteiro para nullary função de membro, pode ser chamada com um ponteiro para objeto 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. (modelo de classe) |
(obsoleta) |
cria um invólucro de um ponteiro para função de membro, pode ser chamada com um ponteiro para objeto 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. (modelo de função) |
(obsoleta) (obsoleta) (obsoleta) (obsoleta) |
wapper para um ponteiro para nullary ou função membro unário, que pode ser chamado com uma referência ao objeto 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. (modelo de classe) |
(obsoleta) |
cria um invólucro de um ponteiro para função de membro, que pode ser chamado com uma referência ao objeto 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. (modelo de função) |