Translations of this page?:
Table of Contents

例外

例外

<exception> ヘッダは例外処理の関数やクラスを提供します。基本クラスのひとつ exception は下記です:

class exception
{
public:
    exception() throw();
    exception(const exception&) throw();
    exception& operator=(const exception&) throw();
    virtual ~exception() throw();
    virtual const char *what() const throw();
};

標準例外

<stdexcept> ヘッダはスローされるキャッチされる例外クラスの小さな階層構造を提供します。

  • exception
    • logic_error
      • domain_error
      • invalid_argument
      • length_error
      • out_of_range
    • runtime_error
      • range_error
      • overflow_error
      • underflow_error

Logic エラーはプログラム中に、ある関数によって引き起された内部エラーがあった場合にスローされます。そして論理的に回避可能です。 Runtime エラーはプログラムとは関係のないユーザには予測不能な原因で引き起された場合にスローされます。

 
• • • SitemapRecent changesRSScc