home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!cs.utexas.edu!geraldo.cc.utexas.edu!emx.cc.utexas.edu!not-for-mail
- From: jamshid@emx.cc.utexas.edu (Jamshid Afshar)
- Newsgroups: comp.lang.c++
- Subject: Re: is 'this' obsolete??!!
- Date: 21 Jan 1993 19:29:06 -0600
- Organization: The University of Texas at Austin, Austin, Texas
- Lines: 23
- Message-ID: <1jnil2INNcsg@emx.cc.utexas.edu>
- References: <1993Jan21.181219.25491@ugle.unit.no> <C189y5.36n@inews.Intel.COM>
- NNTP-Posting-Host: emx.cc.utexas.edu
- Summary: BC++ documentation error. Should say "assignment to this ..."
-
- >>I recently heard someone mention that the use of 'this' is obsolete,
- >>and that another method is preferred... I've forgotton how, sorry.
- >>I also found this claim in the on-line help of Borland C++ 3.1.
-
- >Me too - all of the Borland manuals and help files claim 'this' is obsolete,
- >and should be replaced by some method using the new operator...naturally,
- >they don't give an example, so I continue to use 'this'. Any suggestions?
-
- That's an error in the Borland documentation (in on-line help's "BC++
- Language"|"Keywords"|"this"). It should say "assignment to 'this' is
- obsolete". If you don't know what "assignment to this" is, good. It
- was an early (before cfront 2.0) way to choose a different method of
- memory allocation when one new's a class object. The modern, more
- efficient and safer way is to overload the class' operator new() and
- delete().
-
- Every C++ programmer should have either or both Stroustrup's _C++
- Prog. Lang. 2nd Ed_ and Lippman's _C++ Primer 2nd Ed_. Don't rely on
- a compiler's manuals to learn the language (then again, don't rely on
- most of the C++ books out there to learn the language :-/).
-
- Jamshid Afshar
- jamshid@emx.utexas.edu
-