is_function Class
Тесты, если тип функции.
template<class Ty>
struct is_function;
Параметры
- Ty
Тип для запроса.
Заметки
Экземпляр предиката типа выполняются, если тип Ty тип функции, в противном случае он хранит false.
Пример
// 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);
}
Требования
заголовок:<type_traits>
пространство имен: STD