A simple example:
template<typename _X> // this template parameter should be usable outside!
struct Small {
typedef _X X; // this is tedious!
X foo;
};
template<typename SomeSmall>
struct Big {
typedef typename SomeSmall::X X; // want to use X here!
SomeSmall bar;
X toe;
};
Is there a way to access the template parameter X of Small without using a typedef in the Small class?
Depending on what you’re doing, template template parameters might be a better option: