error: no matching function for call to 'std::exception:exception(const char[16])'

环境:codeblocks

语言:C++

在执行:throw new exception("queue is empty.");

遇到问题:error: no matching function for call to 'std::exception:exception(const char[16])'

解决办法:修改为

std::logic_error e("xxx.");
throw std::exception(e);

记得:

#include <iostream>

using namespace std;

 

posted on 2019-03-07 17:14  zkfopen  阅读(1761)  评论(0编辑  收藏  举报

导航