【发布时间】:2012-06-21 00:44:30
【问题描述】:
我有以下代码:-
class A : public B {
public:
_container (B* b) {
container_ = b;
}
private:
B* container_;
};
void foo(const A& a, const B& b) {
A new_a (a);
new_a._container(&b);
}
如果我尝试使用 icpc12 编译它,我会得到:-
error: no instance of overloaded function "A::_container" matches the argument list
argument types are: (const B *)
object type is: A
new_a._container (&b);
现在,我了解到错误的第一行意味着被调用的函数与可用的函数定义之间存在某种类型的不匹配,我正在尝试使用错误的其他两行来缩小问题的范围信息。
第二行和第三行是什么意思?
【问题讨论】: