谈谈自定义异常的注意点
发布时间:2022-09-01 11:12:38
发布人:syq

自定义异常类必须继承于标准异常类exception
自定义异常类必须重写标准异常中的what方法
virtual const char* what()const throw()//防止父类提前抛出异常 { return this->msg.c_str(); }
下一篇常用集合算法