Function objects
Da cppreference.com.
![]() |
Questa pagina è stata tradotta in modo automatico dalla versione in ineglese della wiki usando Google Translate.
La traduzione potrebbe contenere errori e termini strani. Muovi il puntatore sopra al testo per vedere la versione originale. Puoi aiutarci a correggere gli gli errori. Per ulteriori istruzioni clicca qui. |
Una funzione' oggetto è qualsiasi oggetto per cui è definito l'operatore chiamata di funzione. C + + fornisce numerose funzionalità incorporate in oggetti funzione, nonché di sostegno per la creazione e la manipolazione di oggetti funzione nuovi.
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.
[modifica] Wrapper funzione polimorfa
std::function fornisce il supporto per la memorizzazione di oggetti funzione arbitrari.
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) |
avvolge oggetto invocabile di qualsiasi tipo con la firma specificato chiamata di funzione 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. (classe template) |
(C++11) |
crea un oggetto funzione di un puntatore a un 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. (funzione di modello) |
(C++11) |
l'eccezione generata quando si invoca un std::function vuoto 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) |
[modifica] Associare
std::bind fornisce il supporto per funzione di applicazione parziale, vale a dire gli argomenti vincolanti alle funzioni per la produzione di nuove funzioni.
Original:
std::bind provides support for funzione di applicazione parziale, 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) |
lega uno o più argomenti a un oggetto funzione 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. (funzione di modello) |
(C++11) |
indica che un oggetto è un'espressione std::bind o può essere usato come uno 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. (classe template) |
(C++11) |
indica che un oggetto è un segnaposto standard o può essere usato come uno 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. (classe template) |
Defined in namespace
std::placeholders | |
(C++11) |
segnaposto per gli argomenti non legate in un'espressione 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. (costante) |
[modifica] Wrapper di riferimento
Involucri di riferimento consentono argomenti di riferimento deve essere conservata in oggetti funzione copiabile:
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 involucro di riferimento 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. (classe template) |
(C++11) (C++11) |
crea un std::reference_wrapper con un tipo dedotta dal suo argomento 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. (funzione di modello) |
[modifica] Funzione oggetti
C + + definisce gli oggetti funzionali diversi che rappresentano operazioni aritmetiche e logiche comuni:
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. | |
oggetto funzione attuazione 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. (classe template) | |
oggetto funzione attuazione 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. (classe template) | |
oggetto funzione attuazione 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. (classe template) | |
oggetto funzione attuazione 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. (classe template) | |
oggetto funzione attuazione 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. (classe template) | |
oggetto funzione attuazione -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. (classe template) | |
Original: Comparisons The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
oggetto funzione attuazione 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. (classe template) | |
oggetto funzione attuazione 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. (classe template) | |
oggetto funzione attuazione 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. (classe template) | |
oggetto funzione attuazione 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. (classe template) | |
oggetto funzione attuazione 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. (classe template) | |
oggetto funzione attuazione 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. (classe template) | |
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. | |
oggetto funzione attuazione 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. (classe template) | |
oggetto funzione attuazione 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. (classe template) | |
oggetto funzione attuazione !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. (classe template) | |
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. | |
oggetto funzione attuazione 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. (classe template) | |
oggetto funzione attuazione 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. (classe template) | |
oggetto funzione attuazione 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. (classe template) | |
Original: Negators The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
funzione oggetto wrapper restituisce il complemento del predicato unario che detiene 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. (classe template) | |
funzione oggetto wrapper restituisce il complemento del predicato binario che detiene 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. (classe template) | |
costruisce oggetto personalizzato 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. (funzione di modello) | |
costruisce oggetto personalizzato 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. (funzione di modello) |
[modifica] Sconsigliata in C + +11
Diversi programmi di utilità che hanno fornito supporto funzionale precoce sono deprecati in 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. | |
(deprecato) |
adattatore compatibile unario classe base funzione 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. (classe template) |
(deprecato) |
adattatore compatibile con la funzione di classe di base binaria 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. (classe template) |
Original: Binders The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
(deprecato) (deprecato) |
oggetto funzione che tiene una funzione binaria e uno dei suoi argomenti 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. (classe template) |
(deprecato) (deprecato) |
lega un argomento a una funzione binaria 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. (funzione di modello) |
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. | |
(deprecato) |
adattatore compatibile wrapper per un puntatore a funzione unaria 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. (classe template) |
(deprecato) |
adattatore compatibile wrapper per un puntatore a funzione binaria 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. (classe template) |
(deprecato) |
crea un adattatore compatibile con wrapper di oggetto funzione da un puntatore a funzione 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. (funzione di modello) |
(deprecato) (deprecato) (deprecato) (deprecato) |
wrapper per un puntatore a funzione membro nullary, richiamabile con un puntatore a oggetto 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. (classe template) |
(deprecato) |
crea un wrapper da un puntatore a funzione membro, richiamabile con un puntatore a oggetto 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. (funzione di modello) |
(deprecato) (deprecato) (deprecato) (deprecato) |
Wapper per un puntatore a funzione membro nullary o unario, richiamabile con un riferimento all'oggetto 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. (classe template) |
(deprecato) |
crea un wrapper da un puntatore a funzione membro, richiamabile con un riferimento all'oggetto 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. (funzione di modello) |