Thread View: comp.std.c++
2 messages
2 total messages
Started by Andy Sawyer
Thu, 05 Oct 1995 08:17
Why not op delete(void* v&,size_t);?
Author: Andy Sawyer
Date: Thu, 05 Oct 1995 08:17
Date: Thu, 05 Oct 1995 08:17
26 lines
1542 bytes
1542 bytes
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....dare I suggest the preprocessor option...
#define self (*this)
(P.S. I apologise to those concerned if the above quotes are misattributed)
Regards,
Andy
--
* Andy Sawyer ** e-mail:andys@thone.demon.co.uk ** Compu$erve:100432,1713 **
The opinions expressed above are my own, but you are granted the right to
use and freely distribute them. I accept no responsibility for any injury,
harm or damage arising from their use. -- The Management.
---
[ 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. ]
Re: Why not op delete(void* v&,size_t);?
Author: Steve Clamage
Date: Thu, 05 Oct 1995 18:34
Date: Thu, 05 Oct 1995 18:34
33 lines
1778 bytes
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. ]
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads