How to refer to an alias template of a class A given as a template parameter to a class C that inherits from a template base class B?
#include <vector>
struct A
{
// the alias template I want to refer to:
template<class T>
using Container = std::vector<T>;
};
// the base class
template<template<class> class _Container>
struct B
{
_Container<int> m_container;
};
template<class _A>
struct C : public B< typename _A::Container >
{// ^^^^^^^^^^^^^^^^^^^^^^
};
int main()
{
C<A> foo;
}
I tried several solution by adding the template keyword at every possible place in the statement (like template<class T> typename _A::Container<T>, typename _A::template Container...) but g++ gives either "template argument 1 is invalid" or "type/value mismatch"!