将这一段里的这句话
error: no matching function for call to 'std::exception:exception(const char[16])'
改成
std::logic_error ex("XXXXX");
throw std::exception(ex);
还要带上头文件#include <stdexcept>
std::logic_error只是其中一种,stdexcept定义的异常类还有很多,可以参考https://blog.youkuaiyun.com/fengbingchun/article/details/78303734