Title
Explicit template arguments and operator functions
Status
tc1
Section
13.3 [temp.names]
Submitter
John Wiegley

Created on 1998-08-17.00:00:00 last changed 263 months ago

Messages

Date: 2000-04-15.00:00:00

Proposed resolution (10/00):

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

    operator-function-id:
      operator operator
to
    operator-function-id:
      operator operator
      operator operator < template-argument-listopt >

Date: 2004-09-10.00:00:00

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.

History
Date User Action Args
2003-04-25 00:00:00adminsetstatus: dr -> tc1
2000-11-18 00:00:00adminsetstatus: review -> dr
2000-05-21 00:00:00adminsetmessages: + msg339
2000-05-21 00:00:00adminsetstatus: drafting -> review
1998-08-17 00:00:00admincreate