共用方式為


numeric_limits::is_integer

測試,如果型別具有整數表示。

static const bool is_integer = false;

傳回值

true ,如果型別具有整數表示; false

備註

所有預先定義整數型別具有整數表示。

範例

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

using namespace std;

int main( )
{
   cout << "Whether float objects have an integral representation: "
        << numeric_limits<float>::is_integer
        << endl;
   cout << "Whether double objects have an integral representation: "
        << numeric_limits<double>::is_integer
        << endl;
   cout << "Whether int objects have an integral representation: "
        << numeric_limits<int>::is_integer
        << endl;
   cout << "Whether unsigned char objects have an integral representation: "
        << numeric_limits<unsigned char>::is_integer
        << endl;
}
  

需求

標題: <。>

命名空間: std

請參閱

參考

strstreambuf 類別