Path: utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!tut.cis.ohio-state.edu!rutgers!njin!uupsi!sunic!tut!tukki.jyu.fi!sakkinen From: sakkinen@tukki.jyu.fi (Markku Sakkinen) Newsgroups: comp.std.c++ Subject: Re: 'const' revisited Keywords: const access restrictions Message-ID: <1990Aug10.110939.2227@tukki.jyu.fi> Date: 10 Aug 90 11:09:39 GMT References: <26909@pasteur.Berkeley.EDU> Reply-To: sakkinen@jytko.jyu.fi (Markku Sakkinen) Organization: University of Jyvaskyla, Finland Lines: 27 In article <26909@pasteur.Berkeley.EDU> twagner@madrone.berkeley.edu (Tim Wagner) writes: > >The recent discussion on this newsgroup about the conflicting uses of >'const' gives one pause. Shouldn't something as useful as the two >notions here be corrected in C++? > [rest of long article deleted] Sorry, I have not seen the previous discussion. In my ECOOP'88 paper I had a much simpler suggestion that would be sufficient for most practical cases. Rename "pointer to constant" as it currently stands in C++ into something like "nonmodifying pointer" and introduce also true pointers to constant. If we call ordinary pointers "modifying pointers", then obviously the only safe conversions are from "pointer to constant" to "nonmodifying pointer" and from "modifying pointer" to "nonmodifying pointer". References can be handled analogously to pointers, of course. Markku Sakkinen Department of Computer Science University of Jyvaskyla (a's with umlauts) Seminaarinkatu 15 SF-40100 Jyvaskyla (umlauts again) Finland SAKKINEN@FINJYU.bitnet (alternative network address)