Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!dciem!nrcaer!cognos!geovision!alastair From: alastair@geovision.UUCP (Alastair Mayer) Newsgroups: comp.lang.c++ Subject: Re: Interesting "Feature" of C++ Message-ID: <215@geovision.UUCP> Date: Mon, 2-Nov-87 10:36:48 EST Article-I.D.: geovisio.215 Posted: Mon Nov 2 10:36:48 1987 Date-Received: Thu, 5-Nov-87 23:21:33 EST References: <1787@dasys1.UUCP> <265@otc.oz> Reply-To: alastair@geovision.UUCP (Alastair Mayer) Organization: Geovision Corporation, Ottawa, Canada Lines: 24 In article <265@otc.oz> mikem@otc.oz (Mike Mowbray) writes: >Seems to me that it's not widely understood that "this" is special, (after >all, it's a keyword, not a normal variable), and should not be treated >simply as a pointer that you can do arbitrary things to. (At least not in >the current version of C++;- I recall a hint on the net some time ago that >assignment to this is being abolished in favour of something better.) Aaarrrgghhh!! I certainly hope not! Assigning to this can be very useful, most particularly in operations on lists of objects, where a loop like while (this) { // while (this!=NULL) for the picky // do something this = next; } will do something to the entire list when invoked in the object at the head of the list. Adding other termination conditions allow for other operations, such as finding an item in a list. There may be other ways to do it without assigning to this, but I remain to be convinced that they're "better". -- Alastair JW Mayer BIX: al UUCP: ...!utzoo!dciem!nrcaer!cognos!geovision!alastair "What we really need is a good 5-cent/gram launch vehicle."