🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Why not op delete(void* v&,size_t);?

#2127
From: Steve Clamage
Date: Thu, 05 Oct 1995 18:34
33 lines
1778 bytes
In article 6023@thone.demon.co.uk, Andy Sawyer <andys@thone.demon.co.uk> writes:
>In article <44k3iv$mok@cnn.Princeton.EDU>
>           tim@franck.Princeton.EDU "Tim Hollebeek" writes:

> > Ronald F. Guilmette <rfg@monkeys.com> wrote:
> > >Heck!  If you are going to ask about _that_ why not ask why member
> > >functions get a `this' _pointer_ rather than a `this' reference?
> > >The latter would clearly have been a far better choice.
> > 
> > Agreed. I'm tired of returning *this.

>I also agree....

The reason "this" is a pointer is that it was introduced into C++ before
references were part of the language. If references had been part of C++
at the time, "this" would have been a reference. (I believe you can find
that comment in D&E.)

I hope everyone realizes that it is far too late now to change "this" to
a reference. The change would break every C++ program in exchange for a
very minor notational convenience. (You don't normally need to write "this"
very often in a program, but nearly every program contains a few instances.)

---
Steve Clamage, stephen.clamage@eng.sun.com



---
[ 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: <450tuc$f3g@engnews2.Eng.Sun.COM>
Path: arc1-ca.pugleaf.net!128.32.155.1!matt
References: <6023@thone.demon.co.uk>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!128.32.155.1!matt
From: clamage@Eng.Sun.COM (Steve Clamage)
Newsgroups: comp.std.c++
Subject: Re: Why not op delete(void* v&,size_t);?
Date: 05 Oct 1995 18:34:49 GMT
Organization: Sun Microsystems Inc.
Approved: matt@physics2.Berkeley.EDU (Matt Austern)
Message-ID: <450tuc$f3g@engnews2.Eng.Sun.COM>
References: <6023@thone.demon.co.uk>
Reply-To: clamage@Eng.Sun.COM
NNTP-Posting-Host: physics2.berkeley.edu