c++templatespartial-specialization

Why does the C++ standard not allow function template partial specialization?


I read something that it might be confusing for the compiler to write

template <class T>
void calculator<std::complex<T>>::myMin();

but maybe just give it a hint like so? To make it clear that it is a partial specialization.

template < , class T>
void calculator<std::complex<T>>::myMin();

Solution

  • From http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_closed.html#229 linked by @danh in the comments above:

    Notes from 10/00 meeting:

    A major concern over the idea of partial specialization of function templates is that function templates can be overloaded, unlike class templates. Simply naming the function template in the specialization, as is done for class specialization, is not adequate to identify the template being specialized.