Movatterモバイル変換


[0]ホーム

URL:


Issue 38 - WG21 CWG Issues
Title
Explicit template arguments and operator functions
Status
tc1
Section
13.3 [temp.names]
Submitter
John Wiegley

Created on1998-08-17.00:00:00 last changed277 months ago

Messages

msg339 (view)
Date: 2000-04-15.00:00:00

Proposed resolution (10/00):

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

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

msg56 (view)
Date: 2004-09-10.00:00:00

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

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

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

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

History
DateUserActionArgs
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

[8]ページ先頭

©2009-2026 Movatter.jp