Treating some combinations of template arguments as a special case might provide some performance gains, as in the examples for twice in this section. Alternatively, a template description might fail to work for a set of its possible arguments, as in the examples for sort in this section. Template specialization allows you to define alternative implementations for a given combination of actual template arguments. The template specialization overrides the default instantiation.