Article View: comp.std.c++
Article #3227Re: Give operator. a chance
From: John Max Skaller
Date: Sun, 04 Feb 1996 03:39
Date: Sun, 04 Feb 1996 03:39
56 lines
2970 bytes
2970 bytes
Joe Buck wrote: > > Dan Holmsand <dan@et.se> writes: > >Is operator.() banned from the standards discussion? > > Yes, I suppose it is, but since you brought it up I'll discuss it anyway. > > A formal proposal to add it (from Jim Adcock of Microsoft) was voted down > some time ago. [] > > Some committee members objected that it's against the philosophy of C++ to > change the meaning of a builtin operator.[] > > Others favored a more complex and non-orthogonal version, or, worse, first > said the proposal should be more complex and non-orthogonal and then > objected to the complexity and non-orthogonality in this modified version. > > Others objected that if both operator. and operator-> were overloaded the > class would be just about impossible to implement, [] > > Others (those I respect the most) just said they didn't want extensions > without an extremely strong reason, didn't see a strong enough reason for > operator dot, but just wanted to get C++ standardized. [] For the record the _principal_ argument against operator.() which killed the proposal was simply that it failed to actually provide smart references: an explicit dot was required. For pointers, operator-> is OK, because when no -> is used, you want a pointer and get a smart pointer, and when you want an lvalue, you have to use and explicit -> or * anyhow. But for references, this is not so: "f(lvalue &)" requires an lvalue argument. Operator.() (as proposed by Jim Adcock) doesn't convert the smart reference object to a refernece to its delegee in this context. As I understand it this fact was considered to cast enough doubt on the utility of Jim's proposal to reject it, particularly considering the potential confusion created, and the general lack of consensus on the issue. -- John Max Skaller voice: 61-2-566-2189 81 Glebe Point Rd fax: 61-2-660-0850 GLEBE NSW 2037 web: http://www.maxtal.com.au/~skaller/ AUSTRALIA email: skaller@maxtal.com.au --- [ 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:
<311410F5.1BD1@suphys.physics.su.oz.au>Path:
arc1-ca.pugleaf.net!cs.mu.OZ.AU!bounce-backReferences:
<3102AD11.1663@et.se> <4e8g4t$aa3@hermes.synopsys.com>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!cs.mu.OZ.AU!bounce-back From: John Max Skaller <maxtal@suphys.physics.su.oz.au> Newsgroups: comp.std.c++ Subject: Re: Give operator. a chance Date: 04 Feb 96 03:39:32 GMT Organization: MAXTAL Approved: fjh@cs.mu.oz.au Message-ID: <311410F5.1BD1@suphys.physics.su.oz.au> References: <3102AD11.1663@et.se> <4e8g4t$aa3@hermes.synopsys.com> NNTP-Posting-Host: munta.cs.mu.oz.au X-Original-Date: Sun, 04 Feb 1996 11:50:45 +1000 X-Mailer: Mozilla 2.0b6a (WinNT; I) X-Auth: PGPMoose V1.1 PGP comp.std.c++ iQBFAgUBMRQqiOEDnX0m9pzZAQF7KwGAhUNkuZzQlTcQZHD4QhRqhkcNVTXRd1Bb /izdWP8u2TnZ9xaLBYEG+pZZ+F3r+Q5W =Shg9 Originator: fjh@munta.cs.mu.OZ.AU