私は次のコードを持っています:-
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);
ここで、エラーの最初の行は、呼び出されている関数と使用可能な関数定義の間にある種の型の不一致があることを意味していることを理解しており、エラー メッセージの他の 2 行を使用して問題を絞り込もうとしています。
2行目と3行目はどういう意味ですか?