Template class specialization is similar to specializing template functions (page 400). Once you define a template class for a generic type, specialized versions for specific types are possible. There are two reasons why you specialize template classes.
A template class generates compilation errors for a specific type or does not work properly, and a correct version for that type is necessary.
A template class member function executes slowly for a specific type, and you need to improve performance with a different type-specific function.
There are a few rules you need to know when specializing template classes. First, the class definition for the specialized class must appear after the generic template class ...