Const sucks

Walter Bright newshound1 at digitalmars.com
Mon Sep 10 15:31:52 PDT 2007


Janice Caron wrote:
> You might want to allow
> 
> const(invariant(int)*)* p;
> 
> p is a mutable pointer to a const pointer to an invariant int.
> 
> Since invariant is "stronger" than const, you want to be able to do
> const(invariant(...)), but not invariant(const(...))

invariant(const(...)) will have to be accepted, and it will be treated 
as invariant(invariant(...)). This is just for building a type - it 
doesn't re-type any data.



More information about the Digitalmars-d mailing list