A nested alias can refer to any type, especially by specialization:
template<typename T>
struct Nesting
{
template<typename U>
struct _Nested
{
};
template<typename U>
using Nested = _Nested<U>;
};
template<>
struct Nesting<int>
{
template<typename U>
using Nested = float;
};
Now itβs clear what F<Nesting<int>::Nested<int>>::is_my_nested_classshould be the same as F<float>::is_my_nested_classhow can the compiler do this for the latter case? That is, if I wrote:
static_assert(F<float>::is_my_nested_class, "not nested");
, F<float> F<Nesting<int>::Nested<int>>, . , .