Topic: Casting away const (was const object with constructors)


Author: lrn@watson.ibm.com (Lee R. Nackman)
Date: Wed, 17 Jun 1992 12:04:53 GMT
Raw View
I agree that the ability to cast away const is sometime necessary.
However, casts are too strong because can change the type as well as
get rid of const.  Is any thought being given to introducing a safer
way to cast away const?

Lee Nackman




Author: cok@islsun.Kodak.COM (David Cok)
Date: Thu, 18 Jun 92 11:32:39 GMT
Raw View
In article <1992Jun17.120453.12978@watson.ibm.com> lrn@watson.ibm.com (Lee R. Nackman) writes:
>I agree that the ability to cast away const is sometime necessary.
>However, casts are too strong because can change the type as well as
>get rid of const.  Is any thought being given to introducing a safer
>way to cast away const?
>
>Lee Nackman

I also have on occasion wanted to add or remove constness without having to
specify the type as well.  The syntax seems easy:
  (const) a
  (~const) a

David Cok
Eastman Kodak Company
cok@Kodak.COM