I have a class template nested inside another template. Partially specializing it is easy: I just declare another template< … > block inside its parent.>
I tend not to use nested classes too much. My main complaint is that they have a tendency to bloat the code of the class they are nested in.
I would therefore propose another workaround:
namespace detail
{
template class BImpl;
template class BImpl > {};
template class BImpl {};
}
template
class A
{
template struct B: BImpl {};
};
Just note that it requires to pass X as an argument to BImpl if ever you wish to also specialize A. Funny thing is that in this case, I end up with only partial specialization!