Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!mips!daver!tscs!tct!chip From: chip@tct.uucp (Chip Salzenberg) Newsgroups: comp.lang.c++ Subject: Re: Smart pointers and stupid people (was: garbage collection...) Message-ID: <27C19834.162A@tct.uucp> Date: 19 Feb 91 21:27:15 GMT References: <70606@microsoft.UUCP> <3945@lupine.NCD.COM> <49285@apple.Apple.COM> Organization: Teltronics/TCT, Sarasota, FL Lines: 26 According to ksand@Apple.COM (Kent Sandvik): >Anyway, I have not checked ARM and the ANSI specs/drafts, but I would >be highly surprised if the standards lock the underlying object >memory handling scheme to a plain non-moveable version only. Prepare for a big surprise, then: They _do_ require unmoving objects. A pointer value derived at the beginning of a program had better compare equal to the same pointer value derived at any later time in the same program. And you must remember that pointers to members are not necessarily class pointers: FOO *foo = new FOO; char *p = &foo->member; // other code in which the value of "foo" is not modified if (p != &foo->member) cerr << "This C++ implementation is broken\n"; On the other hand, you can take advantage of the as-if rule. If you (the implementor) can make moveable objects look like fixed objects, perhaps by making _all_ pointers "handle pointers," then that's fine. But the illusion had better be complete, or your compiler will not be standard-conforming. -- Chip Salzenberg at Teltronics/TCT , "I want to mention that my opinions whether real or not are MY opinions." -- the inevitable William "Billy" Steinmetz