【发布时间】:2015-05-12 13:21:43
【问题描述】:
假设我有一个标记为noexcept 的函数,但里面有一行代码可以抛出。那行代码将在 try 块中,并且将捕获异常。这会导致什么吗?
void MyFunc() noexcept
{
try {
throw std::exception("...");
} catch (const std::exception & e) {
// I'll deal with it here...
}
}
【问题讨论】:
标签: c++ exception c++11 noexcept