boost :: exception与std :: nested_exception

时间:2018-08-16 21:00:04

标签: c++11 boost exception-handling

boost :: exception和std :: nested_exception都以不同的方式解决了聚合上下文的问题。 boost :: exception允许使用流运算符添加数据。 std :: nested_exceptions允许使用throw_with_nested()将嵌套的异常添加到原始异常中。

我现在想知道每种技术的优缺点。我通常喜欢尽可能地坚持使用标准的东西,但是是否有一个令人信服的理由来选择boost :: exception而不是嵌套异常?

0 个答案:

没有答案