underflow_error Class

此類別可做為所有報告算術反向溢位而擲回的例外狀況的基底類別中。

class underflow_error : public runtime_error {
public:
    explicit underflow_error(const string& message);
    explicit underflow_error(const char *message);
};

備註

所傳回的值何種是一份訊息.資料

範例

// underflow_error.cpp
// compile with: /EHsc /GR
#include <iostream>

using namespace std;

int main( )
{
   try 
   {
      throw underflow_error( "The number's a bit small, captain!" );
   }
   catch ( exception &e ) {
      cerr << "Caught: " << e.what( ) << endl;
      cerr << "Type: " << typeid( e ).name( ) << endl;
   };
}
  
  

需求

標頭: <stdexcept>

Namespace: 標準

請參閱

參考

runtime_error Class

在標準 C++ 程式庫中的執行緒安全

其他資源

<stdexcept> 成員