Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!ucsd!ucbvax!ulysses!allegra!tk From: tk@allegra.att.com (Thomas Kirk) Newsgroups: comp.lang.c++ Subject: Re: this=this Message-ID: Date: 5 Sep 89 18:57:04 GMT References: <9638@alice.UUCP> <1273@tukki.jyu.fi> Sender: netnews@ulysses.homer.nj.att.com Organization: AT&T Bell Laboratories Lines: 11 In-reply-to: sakkinen@tukki.jyu.fi's message of 5 Sep 89 07:17:35 GMT In article <1273@tukki.jyu.fi> sakkinen@tukki.jyu.fi (Markku Sakkinen) writes: > What useful purpose can 'this=this' possibly have served even > in a constructor or destructor? Help against some bug in earlier > releases of cfront? ... no. in constructors of objects that do their own storage management (that is, by assignment to `this'), it is necessary that all execution paths through the constructor include the assignment. such constructors typically check to see whether the object was allocated on the stack or otherwise; `this=this' makes sense for objects allocated on the stack.