Item 48. Class Template Member Specialization

A common misconception about class template explicit specialization and partial specialization is that a specialization somehow “inherits” something from the primary template. This is not the case. A complete or partial specialization of a class template is a totally separate entity from the primary template and does not “inherit” either interface or implementation from the primary template. However, in a nontechnical sense, specializations do inherit a set of expectations about their interfaces and behaviors, in that users who write generic code to the interface of a primary template generally expect that code to work with specializations as well.

This implies that a complete or partial specialization ...

Get C++ Common Knowledge: Essential Intermediate Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.