is_floating_point Class
Тесты, если тип с плавающей запятой.
template<class Ty>
struct is_floating_point;
Параметры
- Ty
Тип для запроса.
Заметки
Экземпляр предиката типа выполняются, если тип Ty тип с плавающей запятой или a cv-qualified форма типа с плавающей запятой в противном случае он содержит false.
Тип с плавающей запятой одна из float" doubleили long double.
Пример
// std_tr1__type_traits__is_floating_point.cpp
// compile with: /EHsc
#include <type_traits>
#include <iostream>
struct trivial
{
int val;
};
int main()
{
std::cout << "is_floating_point<trivial> == " << std::boolalpha
<< std::is_floating_point<trivial>::value << std::endl;
std::cout << "is_floating_point<int> == " << std::boolalpha
<< std::is_floating_point<int>::value << std::endl;
std::cout << "is_floating_point<float> == " << std::boolalpha
<< std::is_floating_point<float>::value << std::endl;
return (0);
}
Требования
заголовок:<type_traits>
пространство имен: STD