numeric_limits::traps

测试是否捕获有关算法的异常报告为类型实现。

static const bool traps = false;

返回值

true,如果捕获为类型实现; false,如果未启用。

示例

// numeric_limits_traps.cpp
// compile with: /EHsc
#include <iostream>
#include <limits>

using namespace std;

int main( )
{
   cout << "Whether float types have implemented trapping: "
        << numeric_limits<float>::traps
        << endl;
   cout << "Whether double types have implemented trapping: "
        << numeric_limits<double>::traps
        << endl;
   cout << "Whether long int types have implemented trapping: "
        << numeric_limits<long int>::traps
        << endl;
   cout << "Whether unsigned char types have implemented trapping: "
        << numeric_limits<unsigned char>::traps
        << endl;
}
  

要求

标头: <limits>

命名空间: std

请参见

参考

strstreambuf Class