std::exception的带参数构造 为什么用g++编译通不过
绝不原创的飞龙
人工智能领域优质创作者
博客专家认证 2013-11-16 11:53:35 expbeaut.cpp:97:44: 错误: 对‘std::exception::exception(const char [20])’的调用没有匹配的函数
expbeaut.cpp:97:44: 附注: 备选是:
In file included from /usr/include/c++/4.7/ios:40:0,
from /usr/include/c++/4.7/ostream:40,
from /usr/include/c++/4.7/iostream:40,
from expbeaut.cpp:1:
/usr/include/c++/4.7/exception:65:5: 附注: std::exception::exception()
/usr/include/c++/4.7/exception:65:5: 附注: 备选需要 0 实参,但提供了 1 个
/usr/include/c++/4.7/exception:62:9: 附注: constexpr std::exception::exception(const std::exception&)
/usr/include/c++/4.7/exception:62:9: 附注: no known conversion for argument 1 from ‘const char [20]’ to ‘const std::exception&’