This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 115e. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.

2024-11-11


285. Identifying a function template being specialized

Section: 13.9.4  [temp.expl.spec]     Status: NAD     Submitter: Erwin Unruh     Date: 01 May 2001

The Standard does not describe how to handle an example like the following:

    template <class T> int f(T, int);
    template <class T> int f(int, T);

    template<> int f<int>(int, int) { /*...*/ }

It is impossible to determine which of the function templates is being specialized. This problem is related to the discussion of issue 229, in which one of the objections raised against partial specialization of function templates is that it is not possible to determine which template is being specialized.

Notes from 10/01 meeting:

It was decided that while this is true, it's not a problem. You can't call such functions anyway; the call would be ambiguous.