I have a template class for which the base class is also a template parameterized with a type member of one of the outer template type parameters. Example:
template <typename X>
class Adapter : public Generator<typename X::generated_type>{
using G = typename X::generated_type;
};
Here X is some type that has a member generated_type and we want to subclass a Generator for X::generated_type. Because X::generated_type is a dependent name, we have to prefix it with typename when we use it in the base class name.
In the rest of the definition of Adapter, I can use G instead of typename X::generated_type, which is obviously a lot more convenient.
Is there any way to use G in the name of the base class too?
In the actual code it's not this simple; I've tried to distill the example down to the core issue.
The only thing I could think of was to have G as a template parameter and create a wrapper that passes X::generated_type as G.