例外概述

时间:2012-12-21 05:14:38

标签: c++ exception

http://www.cplusplus.com/reference/exception/我提取了以下伪代码:

user-function throws an exception
  does it match the exception-specification (throw() in signature)?
    yes: does it match a catch block (also for base classes) at any nesting level?
      yes: run the catch block
      no: call terminate
    no: call unexpected
      does user-function have bad_exception in its exception-specification?
        yes: does unexpected rethrow it or throws any other exception also not in the 
exception-specification?
          yes: throw bad_exception

terminate
  the function set with set_terminate, default abort()

unexpected
  the function set with set_unexpected, default terminate

uncaught_exception
  returns true if an exception has been thrown and has not yet been caught by its appropriate handler, false otherwise
  may call terminate if another exception is thrown while this function returns true

如你所见,有一些“是的”没有通讯员“没有”。另外,我了解到unexpected已被弃用。有什么东西在它的位置,或它只是消失了?指向异常的简单,清晰和简洁页面的链接将是一个很好的答案,但如果您可以帮助完成非常好的伪代码。

0 个答案:

没有答案