numeric_limits::is_specialized
測試,如果型別已定義明確特製化樣板類別 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