I am trying to use the using directive to cast a public access declaration of a derived class to an inner class template declared in the database. Code:
template <typename T> class Base { public: template<typename U> struct Inner; }; template<typename T> class Derived: private Base<T> { public: using typename Base<T>::template Inner;
Neither g ++ nor clang ++ compiles this code, both complain about
error: expected unqualified identifier before the template
As far as I know, Inner is the dependent name of the template, so you should use ::template and typename when defining its name, since Base<T>::Inner is the dependent type. I tried all possible combinations with / without typename/template and no one compiled. Is there a way to use Inner in the public Derived section?
source share