在C++中,最接近.Net NotSupportedException的替代方案是什么

What is the closest alternative to the .Net NotSupportedException in C++

本文关键字:方案 是什么 NotSupportedException Net C++ 最接近      更新时间:2023-10-16

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

标准为您提供

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