I have a template class inside another template class. How can I write a template function that will accept any combination of inner/outer template class?
template <class X>
struct A
{
template <class Y>
struct B
{
int q;
};
};
template <class X, class Y>
int f( typename A<X>::template B<Y>& ab )
{
return ab.q;
}
int g( A<char>::B<short>& ab )
{
return f( ab ); // Error: Could not deduce template argument
}