【发布时间】:2012-07-06 14:17:00
【问题描述】:
std 构造函数的调用是否需要使用std:: 进行限定?
class whatever : public std::runtime_error
{
public:
explicit whatever(const std::string& what) : runtime_error(what) {}
}; // ^ do I need std:: here?
它可以在我的编译器上运行,但我不确定这种行为是否是标准的。
【问题讨论】:
-
基本上,您是在问是否可以无条件引用基类(不一定是
std)?
标签: c++ exception inheritance constructor namespaces