自定义异总是编译出错解决方法
自定义异总是编译出错
为什么VC++就能顺利通过,MinGW总是编译错误?
新手求解
------解决方案--------------------
写what()吧,必要时可以用来汇报,异常信息。
#include <exception>
#include <string>
class wxdir_error:public std::exception
{
public:
explicit wxdir_error (const std::string &s):std::exception(s.c_str()){}
};
class compiler_error:public std::exception
{
public:
explicit compiler_error (const std::string &s):std::exception(s.c_str()){}
};
class building_error:public std::exception
{
public:
explicit building_error (const std::string &s):std::exception(s.c_str()){}
};
为什么VC++就能顺利通过,MinGW总是编译错误?
新手求解
------解决方案--------------------
写what()吧,必要时可以用来汇报,异常信息。