Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!usc!elroy.jpl.nasa.gov!decwrl!infopiz!lupine!rfg From: rfg@NCD.COM (Ron Guilmette) Newsgroups: comp.lang.c++ Subject: Re: Smart pointers and stupid people (was: garbage collection...) Message-ID: <4186@lupine.NCD.COM> Date: 2 Mar 91 18:35:28 GMT References: <3945@lupine.NCD.COM> <49285@apple.Apple.COM> <27C19834.162A@tct.uucp> Organization: Network Computing Devices, Inc., Mt. View, CA Lines: 41 In article <27C19834.162A@tct.uucp> chip@tct.uucp (Chip Salzenberg) writes: +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... I think that there may have been some misunderstanding regarding the true meaning of my statement to the effect that C++ objects don't move. When I said that C++ objects don't move, I meant that they do not move just like memory locations themselves do not move. Sure, you can copy the *contents* of one location to another, but I have yet to see any program on any computer which caused a little mechanical arm to whiz around inside the machine pulling DRAMS out of sockets and them plugging them into different sockets. (It sure would be entertaining to see such a machine, or such a program however. Perhaps that would be the ultimate in "hardware assisted relocation". :-) Likewise, given some C++ code like: { SOME_TYPE some_object; //... //... } I think that it is fairly clear that `some_object' resides in one (and only one) place throughout its lifetime. That's true even if you copy its *contents* into some other object. -- // Ron Guilmette - C++ Entomologist // Internet: rfg@ncd.com uucp: ...uunet!lupine!rfg // Motto: If it sticks, force it. If it breaks, it needed replacing anyway.