template<class T>using WWW=XXX<D,T>;
or, if you have no space to do a using
argument:
template<int D>struct WW{
template<class T>using W=XXX<D,T>;
};
template<int D>
class ZZZ : public YYY<WW<D>::template W>
I advise using different names.