<stdexcept>

std::underflow_error

class underflow_error;
Underflow error exception

This class defines the type of objects thrown as exceptions to arithmetic underflow errors.

No component of the standard library throws exceptions of this type. It is designed as a standard exception to be thrown by programs.

It is defined as
1
2
3
4
class underflow_error : public runtime_error {
public:
  explicit underflow_error (const string& what_arg);
};
1
2
3
4
5
class underflow_error : public runtime_error {
public:
  explicit underflow_error (const string& what_arg);
  explicit underflow_error (const char* what_arg);
};

成員

建構函式
傳遞給 what_arg 的字串與成員 what 返回的值內容相同。

該類從 runtime_error 繼承了 what 成員函式。

異常安全

強保證: 如果建構函式丟擲異常,則沒有副作用。

另見