测试,如果类型具有定义的显式专用化模板中 numeric_limits类。
static const bool is_specialized = false;
返回值
true,如果类型具有定义的显式专用化。模板类;false,则不是。
备注
除指针类型以外的任何标量为定义模板类的显式专用化。numeric_limits
示例
// numeric_limits_is_specialized.cpp
// compile with: /EHsc
#include <iostream>
#include <limits>
using namespace std;
int main( )
{
cout << "Whether float objects have an explicit "
<< "specialization in the class: "
<< numeric_limits<float>::is_specialized
<< endl;
cout << "Whether float* objects have an explicit "
<< "specialization in the class: "
<< numeric_limits<float*>::is_specialized
<< endl;
cout << "Whether int objects have an explicit "
<< "specialization in the class: "
<< numeric_limits<int>::is_specialized
<< endl;
cout << "Whether int* objects have an explicit "
<< "specialization in the class: "
<< numeric_limits<int*>::is_specialized
<< endl;
}
要求
页眉: <限制>
命名空间: std