std::result_of - cppreference.com
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. |
<metanoindex/>
<tbody> </tbody>
| Elemento definito nell'header <type_traits> |
||
|
|
(1) | (dal C++11) |
|
|
(2) | (dal C++11) |
Deduce il tipo di ritorno di una espressione chiamata di funzione al momento della compilazione.
Original:
Deduces the return type of a function call expression at compile time.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Membri tipi
Membro tipo Original: Member type The text has been machine-translated via Google Translate. |
Definition |
type
|
il tipo di ritorno della funzione se Original: the return type of the function The text has been machine-translated via Google Translate. |
Possibile implementazione
template<class> struct result_of; template<class F, class... ArgTypes> struct result_of<F(ArgTypes...)> { typedef decltype( std::declval<F>()(std::declval<ArgTypes>()...) ) type; };
Esempio
struct S { double operator()(char, int&); }; int main() { std::result_of<S(char, int&)>::type f = 3.14; // f has type double }
Vedi anche
ottiene il tipo di espressione in un contesto non valutata Original: obtains the type of expression in unevaluated context The text has been machine-translated via Google Translate. (funzione di modello) [modifica] | |