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

2024-04-05


38. Explicit template arguments and operator functions

Section: 13.3  [temp.names]     Status: TC1     Submitter: John Wiegley     Date: 17 Aug 1998

It appears from the grammar that explicit template arguments cannot be specified for overloaded operator names. Does this mean that template operators can never be friends?

But assuming that I read things wrong, then I should be able to specify a global template 'operator +' by writing:

    friend A::B operator + <>(char&);
John Spicer:

You should be able to have explicit template arguments on operator functions, but the grammar does seem to prohibit it (unless I'm reading it incorrectly). This is an error in the grammar, they should be permitted.

Proposed resolution (10/00):

Change the grammar specified in 12.4 [over.oper] paragraph 1 from

to