Use ‘namespace’ of one base class (Template diamond-problem C++)

  alias, c++, crtp, diamond-problem, inheritance

Is it possible to resolve method ambiguity by using the ‘namespace’ of a base class?
Say I want D to use the C-inherited base-class instance of A, but A has a lot of methods and data members.

Diamond-problem

In this case I’d have to type (In D):

class D: public B, public C
{

using C::method1;
using C::method2;
using C::method3;
...
Type1& T1 = C::T1;
Type2& T2 = C::T2;
...
}

Is it possible to simplify this to something like this?

using namespace C;

Source: Windows Questions C++

LEAVE A COMMENT