测试,如果类型具有一种整数表示形式。
static const bool is_integer = false;
返回值
true,如果类型具有一种整数表示形式;false,则不是。
备注
所有的预定义整数类型具有一种整数表示形式。
示例
// numeric_limits_is_integer.cpp
// compile with: /EHsc
#include <iostream>
#include <limits>
using namespace std;
int main( )
{
cout << "Whether float objects have an integral representation: "
<< numeric_limits<float>::is_integer
<< endl;
cout << "Whether double objects have an integral representation: "
<< numeric_limits<double>::is_integer
<< endl;
cout << "Whether int objects have an integral representation: "
<< numeric_limits<int>::is_integer
<< endl;
cout << "Whether unsigned char objects have an integral representation: "
<< numeric_limits<unsigned char>::is_integer
<< endl;
}
要求
页眉: <限制>
命名空间: std