templated class : accessing derived normal-class methods
- by user1019129
I have something like this :
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(); ...; }
}
My question is why I have to use "using C::method1()", to be able to access the method..
Most of answers I found is for the case where templated-class inhering templated-class. Normally they mention using "this-", but this does not seem to work in this case.
Can I do something else shorter...
Also I'm suspecting the other error I'm getting is related to the same problem :
no match call for (X<Container1>) (<std::string&>)