【发布时间】:2013-05-13 00:03:03
【问题描述】:
例如:
#include <stdexcept>
class A { };
class err : public A, public std::runtime_error("") { };
int main() {
err x;
return 0;
}
("") 在runtime_error 之后我得到:
error: expected '{' before '(' token
error: expected unqualified-id before string constant
error: expected ')' before string constant
否则(没有(""))我明白了
In constructor 'err::err()':
error: no matching function for call to 'std::runtime_error::runtime_error()'
怎么了?
(你可以在这里测试:http://www.compileonline.com/compile_cpp_online.php)
【问题讨论】:
标签: c++ inheritance runtime-error