std::numeric_limits::is_integer

static const bool is_integer;
(C++11 前)
static constexpr bool is_integer;
(C++11 起)

std::numeric_limits<T>::is_integer 的值对所有整数算术类型 Ttrue ,对其他为 false 。此常量对所有特化有意义。

标准特化

T std::numeric_limits<T>::is_integer 的值
/* non-specialized */ false
bool true
char true
signed char true
unsigned char true
wchar_t true
char16_t true
char32_t true
short true
unsigned short true
int true
unsigned int true
long true
unsigned long true
long long true
unsigned long long true
float false
double false
long double false

参阅

(C++11)
检查类型是否为整型
(类模板)
[静态]
鉴别有符号类型
(公开静态成员常量)
[静态]
鉴别准确表示的类型
(公开静态成员常量)
[静态]
鉴别表示有限值集合的类型
(公开静态成员常量)

版本历史

  • (当前 | 先前 2017年4月26日 (三) 01:31Fruderica讨论 | 贡献. . (1,742字节) (-533). . (撤销)
  • 当前 | 先前 2013年7月2日 (二) 11:47P12bot讨论 | 贡献 . . (2,275字节) (-337). . (Use {{lc}}. Update links. Various fixes.) (撤销)
  • 当前 | 先前 2012年11月2日 (五) 15:06P12bot讨论 | 贡献 . . (2,612字节) (+345). . (r2.7.3) (机器人添加:de, en, es, fr, it, ja, pt, ru) (撤销)
  • 当前 | 先前 2012年10月27日 (六) 12:12P12讨论 | 贡献 . . (2,267字节) (0). . (1个修订: Translate from the English version) (撤销)
  • 当前 | 先前 2012年10月26日 (五) 06:00TranslationBot讨论 | 贡献. . (2,267字节) (-22). . (Translated from the English version using Google Translate) (撤销)
  • 当前 | 先前 2012年10月26日 (五) 03:53P12讨论 | 贡献 . . (2,289字节) (0). . (1个修订: Translate from the English version) (撤销)
  • 当前 | 先前) 2012年10月25日 (四) 12:00TranslationBot讨论 | 贡献. . (2,289字节) (+2,289). . (Translated from the English version using Google Translate)