如果类型的有符号的表示形式,测试。
static const bool is_signed = false;
返回值
true,如果该类型的有符号的表示形式; false,如果没有。
备注
该成员存储为true的有符号的表示形式,是所有预定义的浮点和带符号整数类型的用例的类型。
示例
// numeric_limits_is_signaled.cpp
// compile with: /EHsc
#include <iostream>
#include <limits>
using namespace std;
int main( )
{
cout << "Whether float objects have a signed representation: "
<< numeric_limits<float>::is_signed
<< endl;
cout << "Whether double objects have a signed representation: "
<< numeric_limits<double>::is_signed
<< endl;
cout << "Whether signed char objects have a signed representation: "
<< numeric_limits<signed char>::is_signed
<< endl;
cout << "Whether unsigned char objects have a signed representation: "
<< numeric_limits<unsigned char>::is_signed
<< endl;
}
要求
标头: <limits>
命名空间: std