共用方式為


numeric_limits::is_specialized

Tests if a type has an explicit specialization defined in the template class numeric_limits.

static const bool is_specialized = false;

Return Value

true if the type has an explicit specialization defined in the template class; false if not.

Remarks

All scalar types other than pointers have an explicit specialization defined for template class numeric_limits.

Example

// 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;
}

Whether float objects have an explicit specialization in the class: 1
Whether float* objects have an explicit specialization in the class: 0
Whether int objects have an explicit specialization in the class: 1
Whether int* objects have an explicit specialization in the class: 0

Requirements

Header: <limits>

Namespace: std

See Also

Concepts

strstreambuf Class

numeric_limits Members