Article View: comp.std.c++
Article #289Re: 'const' revisited
From: Markku Sakkinen
Date: Fri, 10 Aug 1990 11:09
Date: Fri, 10 Aug 1990 11:09
27 lines
1634 bytes
1634 bytes
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)
Technical Details
Message-ID:
<1990Aug10.110939.2227@tukki.jyu.fi>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!tut.cis.ohio-state.edu!rutgers!njin!uupsi!sunic!tut!tukki.jyu.fi!sakkinenReferences:
<26909@pasteur.Berkeley.EDU>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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