Partial Template Specialization allows you to define a subset in all possible entities of a Template. 1. template specialization: for example, defines the following template: template <class Window, class Controller> class Widget {... generalized implementation code ...}; then you can define the template as follows: template <> // Note: The angle brackets behind the template do not contain any content; class Widget <ModalDialog, MyController> {... code for special implementation ...}; modalDialog and MyController are other classes defined by you. With the special definition of this Widget, if you define a Widget <ModalDialog, MyController> object in the future, the compiler uses the preceding special definition. If other generic objects are defined, the compiler uses the original generalized definition. This is the template's special definition. 2. partial Template Specialization (Template-specific) Template Specialization is implemented by "giving all Template parameters in the Template a specific class. template features are implemented by "giving some template parameters in the template specific classes, while leaving the remaining template parameters still using the original generalized definition". For example, as for the definition of the Widget-class template above, sometimes we want to match a specific MyController-class special Widget with any Window. In this case, we need to use the template-specific mechanism. the following Widget class template is the partial definition of widgets: template <class Window> // still uses the original generalized definition; class Widget <Window, myController> // MyController is a specific class and is a special definition ;{... code for special implementation ...}; this is a special definition. A MyController class can be used with any Window. in the partial special definition of a class template, you only need to specify some template parameters and leave other generalized parameters. when you implement the above class template in a program, the compiler will try to find the most matching template definition. this search process is very complex and fine-grained, allowing you to differentiate in creative ways. for example, if you have a Button template with a template parameter, you can use any Window with a specific MyController to customize the Widget, you can also use any Button with a specific MyController to optimize the Widget: template <class ButtonArg> www.2cto.com class Widget <Button <ButtonArg>, myController> // use any Button to match the specific class MyContorller {... code for special implementation ...}; templates are highly specialized. when you instantiate a template, the compiler compares the existing partial and full special templates and finds out the most appropriate and matched implementations. in this way, the flexibility is great. however, unfortunately, the bitrate mechanism of the template cannot be used in functions, whether it is a member function or a non-member function. note: 1. although you can fully specialize in the member functions in the class template, you cannot be partial to them; 2. you cannot describe the namespace-level functions (non-member ). function Overloading is the most specific mechanism close to "namespace-level template functions", which means that you have "function parameters" (rather than the return value type or internal use type) excellent special ability; 3. in special or full special mode, NO content is included in the angle brackets behind the template. Conclusion: The template special/full special mode refers to a specific type for each template parameter, this template is implemented in a specific way, and the angle brackets behind the template do not contain any content. The template's special feature only gives some template parameters a specific type to implement this template;