🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c++
Article #1757

Re: STL operators != > <= >=

#1757
From: mfinney
Date: Mon, 21 Aug 1995 02:01
23 lines
1885 bytes
In <MATT.95Aug20111412@Austern>, maxtal@Physics.usyd.edu.au (John Max Skaller) writes:
>	template<class T, class U> void f(T,U); //#1
>	template<class T, class U> int f(T,U);  //#2

Your argument breaks down here because the standard does NOT allow the
return type to participate in overloading.  The overload must be resolvable
using only the function name and the parameter types.  Since these two
signatures do NOT differ (the return type is not considered) they would not
be allowed.  If I may quote from the draft standard, page 13_7, footnote 87...

"87) Note that this construction can yield candidate call functions that cannot
be differentiated one from the other by overload resolution because they
have identical declarations or differ only in their return type.  The call will
be ambiguous if overload resolution cannot select a match to the call that
is uniquely better than such undifferentiable functions."


Michael Lee Finney


[ comp.std.c++ is moderated.  Submission address: std-c++@ncar.ucar.edu.
  Contact address: std-c++-request@ncar.ucar.edu.  The moderation policy
  is summarized in http://dogbert.lbl.gov/~matt/std-c++/policy.html. ]
Technical Details
Message-ID: <41891f$ihs@mujibur.inmind.com>
Path: arc1-ca.pugleaf.net!engnews2.Eng.Sun.COM!taumet!clamage
References: <3vpmv5$4t7@mujibur.inmind.com> <408o8u$c0p@hermes.synopsys.com> <MATT.95Aug14092229@physics10.berkeley.edu> <MATT.95Aug16101930@physics2.Berkeley.EDU> <MATT.95Aug20111412@Austern>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!engnews2.Eng.Sun.COM!taumet!clamage
From: mfinney@inmind.com
Newsgroups: comp.std.c++
Subject: Re: STL operators != > <= >=
Date: 21 Aug 1995 02:01:35 GMT
Organization: In Mind, Inc.
Approved: clamage@eng.sun.com (comp.std.c++)
Message-ID: <41891f$ihs@mujibur.inmind.com>
References: <3vpmv5$4t7@mujibur.inmind.com> <408o8u$c0p@hermes.synopsys.com> <MATT.95Aug14092229@physics10.berkeley.edu> <MATT.95Aug16101930@physics2.Berkeley.EDU> <MATT.95Aug20111412@Austern>
Reply-To: mfinney@inmind.com
NNTP-Posting-Host: taumet.eng.sun.com
Content-Type: text
X-Nntp-Posting-Host: finneyman.inmind.com
X-Newsreader: IBM NewsReader/2 v1.2
Content-Length: 944
Originator: clamage@taumet