Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!cs.utexas.edu!usc!apple!apple.com!arn From: arn@apple.com (Arn Schaeffer) Newsgroups: comp.lang.c++ Subject: Re: Const member function semantics Message-ID: <3031@internal.Apple.COM> Date: 24 Jul 89 16:00:19 GMT Sender: usenet@Apple.COM Organization: Apple Computer, Inc. Lines: 21 References:<2943@internal.Apple.COM> <9662@alice.UUCP> In article <9662@alice.UUCP> ark@alice.UUCP (Andrew Koenig) writes: > Well, you can use a cast to remove the constness of `this' > if you insist. Opinions are divided, however, about whether > such an operation should always be guaranteed to work. Your solution works great if I ALWAYS want const to make the "object hasn't changed in a way perceptible through the external interface" statement. I guess what I wanted was a way to do both things. It seems to me that there needs to be a way to make the statement at the interface level otherwise clients who expect const to be a storage statement will be disappointed (or bus error.) Perhaps this statement could be made with the addition of yet another type specifier. For example, "const" could make the statement that the storage for this object is not mucked with and "stable" (or some better word) could make the statement that this object isn't mucked with in a way perceptible through the external interface. Arn Schaeffer Apple Computer arn@apple.com The opinions expressed are not necessarily those of Apple Computer.