在线文档教程
C++
应用 | Utilities

std::numeric_limits::is_integer

STD::数字[医]限制::IS[医]整型

static const bool is_integer;(until C++11)
static constexpr bool is_integer;(since C++11)

价值std::numeric_limits<T>::is_integer是true对于所有整数算术类型T和false否则。这个常量对于所有的专门化都是有意义的。

标准专业化

Tvalue of std::numeric_limits::is_integer
/* non-specialized */false
booltrue
chartrue
signed chartrue
unsigned chartrue
wchar_ttrue
char16_ttrue
char32_ttrue
shorttrue
unsigned shorttrue
inttrue
unsigned inttrue
longtrue
unsigned longtrue
long longtrue
unsigned long longtrue
floatfalse
doublefalse
long doublefalse

另见

is_integral (C++11)checks if a type is integral type (class template)
is_signed staticidentifies signed types (public static member constant)
is_exact staticidentifies exact types (public static member constant)
is_bounded staticidentifies types that represent a finite set of values (public static member constant)

© cppreference.com

在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。

http://en.cppreference.com/w/cpp/type/NUMERIC[医]限制/IS[医]整型