首页 > 其他 > 详细

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

时间:2019-10-07 10:01:00      阅读:136      评论:0      收藏:0      [点我收藏+]

在复现《剑指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);

 

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

原文:https://www.cnblogs.com/xiangsui/p/11629510.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!