Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!sdd.hp.com!zaphod.mps.ohio-state.edu!julius.cs.uiuc.edu!apple!bbn.com!nic!hri!sparc17!roman From: roman@hri.com (Roman Budzianowski) Newsgroups: comp.lang.c++ Subject: Re: this in Heap-/Stack Objects Message-ID: <1990Oct11.150419.9878@hri.com> Date: 11 Oct 90 15:04:19 GMT References: <1990Oct9.173642.5187@athena.mit.edu> <1990Oct9.162831@jellosub.luftfahrt.uni-stuttgart.de> Sender: news@hri.com Reply-To: roman@hri.com (Roman Budzianowski) Organization: Horizon Research Lines: 14 |> "... code is secretly generated in a constructor to differ- |> entiate between objects created on the stack (the value of |> 'this' when the constructor is called is non-zero) and objects |> created on the free store (the value of 'this' when the con- |> structor is called is zero)..." Ack! Retch! You don't have to look at anything secret to determine if an object is on the stack. Compare the value of 'this' to some value you know is on the stack. The comparison is machine dependent and nonportable.