With a partial specialization, like that:
template <class... Pack>
class Foo
{
class SomeClass {};
template <class OtherFoo> // OtherFoo = anything, but undefined
struct TT_t;
template <class... P> // OtherFoo = Foo with other template parameters
struct TT_t <Foo <P...> > { using type = typename Foo <P...>::SomeClass };
template <class OtherFoo> // OtherFoo = Foo with other template parameters
using TT = typename TT_t <OtherFoo>::type;
};
So if you try to instantiate TT
with any parameter other than another Foo
, the compiler will issue an error, saying that TT_t
is an incomplete type. I hope this is what you were after.