私はこのようなものを持っています:
class Container1 {
public:
method1() { ... }
}
class Container2 {
public:
method1() { ... }
}
template<class C = Container1>
class X : public C {
public:
using C::method1();
.....
X(string& str) : C(str) {};
X& other_method() { method1(); ...; }
}
私の質問は、メソッドにアクセスできるようにするために「using C::method1()」を使用する必要がある理由です..私が見つけた答えのほとんどは、テンプレートクラスがテンプレートクラスを継承している場合です。通常、"this->" の使用について言及されていますが、この場合はうまくいかないようです。もう少し短くできるかな…
また、私が得ている他のエラーは同じ問題に関連していると思われます:
no match call for (X<Container1>) (<std::string&>)