From 701689909065035488
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,f9d03435d36a70ff
X-Google-Attributes: gidf78e5,public
X-Google-ArrivalTime: 1990-08-10 14:23:33 PST
Path: gmdzi!unido!mcsun!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
Posted: Fri Aug 10 12:09:39 1990

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)


