#include <vector>
template < class a > class innervec {
inner();
~inner();
std::vector<a> innerdata;
};
template < class a, template <class a> class inner > class outer {
outer();
~outer();
a *myPtr;
inner<a> myInner;
};
//Edit to provide examples
template < class a > class innerlist {
otherinner();
~otherinner();
std::list<a> innerdata
}
//call sites
//Use outer with vector inner with int type
outer<int, innervec> OuterWithVec()
//Use outer with list inner with double type
outer<double, innerlist> OuterWithList()
https://godbolt.org/z/j3ofqE4fj
Similar question Can a parameter of a template template parameter cause shadowing?
I'm attempting to refactor some code, and with a newer compiler I get this error. I understand that is not valid C++, but The original question doesn't seem to directly answer "What is the correct solution?"
In this case I simply want to pass the same template parameter to the inner template parameter, right now my outer template class only has a pointer of the template type, and a member of type "inner templated class" where the inner parameter is simply passed through. (I think this was the original purpose of this design).