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

在复现《剑指offer》代码段:

throw new exception("queue is empty");

时,遇到:

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

解决方法:

#include <stdexcept>

std::logic_error e("queue is empty");
throw std::exception(e);
原文地址:https://www.cnblogs.com/xiangsui/p/11629510.html