TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: ROGER SCUDDER
from: JONATHAN DE BOYNE POLLARD
date: 1998-01-30 12:05:00
subject: this

 RS>   What is the scoop with this?  
The keyword `this' ?
 RS> BC++ 3.1 tells me it's obsolete.  Is that correct?
Assignment to `this' in a constructor is obsolete, yes.  In early versions of 
the C++ language, *very* early versions, operators new and delete did not 
exist for individual classes, and so overriding the default memory allocator 
for a particular class was done by assigning to `this' in the middle of a 
constructor.  However, this mechanism was clumsy and difficult, and has long 
since been replaced by class-specific new and delete operators.  
Modern C++ implementations, and implementations of *Standard* C++, give 
`this' the type `T * const', where `T' is the class, as a consequence of 
which it cannot be assigned to.
The keyword `this' is, in itself, *not* obsolete, however.
 ¯ JdeBP ®
--- FleetStreet 1.19 NR
---------------
* Origin: JdeBP's point, using Squish (2:440/4.3)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.