From -7471232601340298104
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,d40995f71ce940ac
X-Google-Attributes: gidf78e5,public
X-Google-ArrivalTime: 1990-07-30 19:48:36 PST
Path: gmdzi!unido!mcsun!uunet!tut.cis.ohio-state.edu!uc!cs.umn.edu!ux.acs!hopper
From: hopper@ux.acs.umn.edu (hopper)
Newsgroups: comp.std.c++
Subject: Re: casting "const" to "non-const"
Message-ID: <1913@ux.acs.umn.edu>
Date: 31 Jul 90 02:48:36 GMT
References: <56159@microsoft.UUCP> <56163@microsoft.UUCP>
Reply-To: hopper@ux.acs.umn.edu (Nils  McCarthy)
Organization: Omnifarious Software
Lines: 28
Posted: Tue Jul 31 03:48:36 1990

In article <56163@microsoft.UUCP> jimad@microsoft.UUCP (Jim ADCOCK) writes:
>Proposed:
>
>That when a parameter [including the hidden "this" parameter] is declared 
>"const", or when the object referenced by a parameter is declared "const",
>than it is not legal to modify that which is declared "const" within the 
>function. This is to say, the trick of casting to a non-const does not 
>work on a parameter declared as "const."  Compilers can flag as an error 
>these situations.
>

	I don't agree with the illegalization of this construct. I think it
is against the spirit of the language to illegalize a cast.

	In C, and C++ a cast is supposed to always work, no matter what
object you're casting. I think that it should be legal for compilers to
preform optimizations based on the information given by declaring a const
parameter, but programmers should be allowed to cast if they feel it
neccesary.

Have fun,
UUCP: rutgers!umn-cs!ux.acs.umn.edu!hopper   (Eric Hopper)
     __                    /)                       /**********************/
    / ')                  //                         * I went insane to   *
   /  / ______  ____  o  //  __.  __  o ____. . _    * preserve my sanity *
  (__/ / / / <_/ / <_<__//__(_/|_/ (_<_(_) (_/_/_)_  * for later.         *
Internet:              />                            * -- Ford Prefect    *
hopper@ux.acs.umn.edu </  #include <disclaimer.h>   /**********************/


