std::exception::exception

exception();
(1)
exception( const exception& other );
(2)

构造新的异常对象。

1) 默认构造函数。 what() 返回空字符串。
2) 复制构造函数。以 other 的内容初始化其内容。

参数

other - 要赋值内容的另一 exception

异常

(无) (C++11 前)
noexcept 规定:  
noexcept
  
(C++11 起)

注意

因为不允许复制 std::exception 抛出异常,故当导出类(例如 std::runtime_error )必须管理用户定义的诊断信息时,它典型地实现为写时复制的字符串。

版本历史

  • (当前 | 先前 2017年4月30日 (日) 18:27Fruderica讨论 | 贡献. . (845字节) (-183). . (撤销)
  • 当前 | 先前 2013年7月2日 (二) 08:03P12bot讨论 | 贡献 . . (1,028字节) (-60). . (Use {{lc}}. Update links. Various fixes.) (撤销)
  • 当前 | 先前 2012年11月2日 (五) 15:02P12bot讨论 | 贡献 . . (1,088字节) (+297). . (r2.7.3) (机器人添加:de, en, es, fr, it, ja, pt, ru) (撤销)
  • 当前 | 先前 2012年10月26日 (五) 10:36P12讨论 | 贡献 . . (791字节) (0). . (1个修订: Translate from the English version) (撤销)
  • 当前 | 先前 2012年10月26日 (五) 06:00TranslationBot讨论 | 贡献. . (791字节) (-30). . (Translated from the English version using Google Translate) (撤销)
  • 当前 | 先前 2012年10月25日 (四) 13:24P12讨论 | 贡献 . . (821字节) (0). . (1个修订: Translate from the English version) (撤销)
  • 当前 | 先前) 2012年10月25日 (四) 12:00TranslationBot讨论 | 贡献. . (821字节) (+821). . (Translated from the English version using Google Translate)