Lionel said:
Interesting. The example in the FAQ:
http://www.parashift.com/c++-faq-lite/templates.html#faq-35.7
is admittedly not "partial" specialisation, but, assuming that it
represents correct usage of the term "function template specialisation",
are you implying that as soon as we specialise/overload/whatever-you-call-
it on only *one* of several template arguments it ceases to be
specialisation at all and becomes "function template overloading"? That
seems a bit cranky terminology-wise to me.
Function templates can be overloaded with other function templates and with
other functions. That's what happening here. There is no partial
specialisation of function templates.
Vandevoorde and Josuttis writes in /C++ Templates: The Complete Guide/:
You may legitimately wonder why only class templates can be partially
specialized. The reasons are mostly historical. It is probably possible to
define the same mechanism for function templates (see Chapter 13). In some
ways the effect of overloading function templates is similar, but there are
also some subtle differences. These differences are mostly related to the
fact that only the primary template needs to be looked up when a use is
encountered. The specializations are considered only afterward, to
determine which implementation should be used. In contrast, all overloaded
function templates must be brought into an overload set by looking them up,
and they may come from different namespaces or classes. This increases the
likelihood of unintentionally overloading a template name somewhat.
Chapter 13 discusses future directions.