◐ Shell
clean mode source ↗

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.

Click here for the English version of this page

<metanoindex/>

<tbody> </tbody>

Elemento definito nell'header

<type_traits>

template< class > class result_of; //not defined

(1) (dal C++11)

template< class F, class... ArgTypes > class result_of<F(ArgTypes...)>;

(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.
You can help to correct and verify the translation. Click here for instructions.

Definition
type

il tipo di ritorno della funzione se F chiamata con il ArgTypes... argomenti

Original:

the return type of the function F if called with the arguments ArgTypes...

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

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.
You can help to correct and verify the translation. Click here for instructions.


(funzione di modello) [modifica]