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: 標準