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