is_function Class
Verificare se il tipo è un tipo di funzione.
template<class Ty>
struct is_function;
Parametri
- Ty
Il tipo da eseguire la query.
Note
Un'istanza del predicato del tipo per poter se il tipo Ty è un tipo di funzione contenuta in caso contrario, false.
Esempio
// std_tr1__type_traits__is_function.cpp
// compile with: /EHsc
#include <type_traits>
#include <iostream>
struct trivial
{
int val;
};
struct functional
{
int f();
};
int main()
{
std::cout << "is_function<trivial> == " << std::boolalpha
<< std::is_function<trivial>::value << std::endl;
std::cout << "is_function<functional> == " << std::boolalpha
<< std::is_function<functional>::value << std::endl;
std::cout << "is_function<float()> == " << std::boolalpha
<< std::is_function<float()>::value << std::endl;
return (0);
}
Requisiti
intestazione: <type_traits>
Spazio dei nomi: deviazione standard