Saturday, January 18, 2014

class template partial specialization c++

Partial Specialization : templates tutorial ccplusplus.com
Class templates can be partially specialized. You can specify special implementations for particular circumstances, but some template parameters must still be defined by the user. For example, for the following class template


the following partial specializations are possible:


The following example shows which template is used by which declaration:


If more than one partial specialization matches equally well, the declaration is ambiguous:


To resolve the second ambiguity, you can provide an additional partial specialization for pointers of the same type:










-----------------------------------------------------------------
See Also:
-----------------------------------------------------------------

-----------------------------------------------------------------

No comments:

Post a Comment