【发布时间】:2013-07-04 07:26:57
【问题描述】:
标准库中最接近 .Net NotSupportedException 的替代方案是什么?如果我必须创建我自己的一个,它应该从逻辑上派生出什么?
【问题讨论】:
-
对我来说听起来像是
std::runtime_error。
标签: c++ exception exception-handling stl std
标准库中最接近 .Net NotSupportedException 的替代方案是什么?如果我必须创建我自己的一个,它应该从逻辑上派生出什么?
【问题讨论】:
std::runtime_error。
标签: c++ exception exception-handling stl std
标准给你
namespace std {
class logic_error;
class domain_error;
class invalid_argument;
class length_error;
class out_of_range;
class runtime_error;
class range_error;
class overflow_error;
class underflow_error;
}
正如 Jerry 所说,runtime_error 是其中的最佳匹配,因此从中派生。
【讨论】: