is_function — Klasa
Sprawdza, czy typ jest typ funkcji.
template<class Ty>
struct is_function;
Parametry
- Ty
Typ kwerendy.
Uwagi
Wystąpienie typu predykat posiada wartość PRAWDA, jeśli typ Ty jest typ funkcji w inny sposób przechowuje wartość false.
Przykład
// 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);
}
Wymagania
Nagłówek: <type_traits>
Przestrzeń nazw: std