【问题标题】:What is the closest alternative to the .Net NotSupportedException in C++什么是 C++ 中 .Net NotSupportedException 最接近的替代方案
【发布时间】:2013-07-04 07:26:57
【问题描述】:

标准库中最接近 .Net NotSupportedException 的替代方案是什么?如果我必须创建我自己的一个,它应该从逻辑上派生出什么?

【问题讨论】:

  • 对我来说听起来像是std::runtime_error

标签: c++ exception exception-handling stl std


【解决方案1】:

标准给你

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 是其中的最佳匹配,因此从中派生。

【讨论】:

    猜你喜欢
    • 2017-06-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-01-17
    • 2014-02-11
    • 2015-12-25
    • 1970-01-01
    • 2018-03-25
    相关资源
    最近更新 更多