Invariant Question (yes, another one)

Xinok xnknet at gmail.com
Thu Nov 15 06:25:09 PST 2007


Const is the read-only type, meaning that the data COULD change 
unexpectedly. However, invariant means the data is guaranteed never to 
change. You can't guarantee const data is never going to change, which 
is why it gives you an error.

Janice Caron wrote:
> I got this error...
> 
> Error: cannot implicitly convert expression (aa) of type
> invariant(char)[][invariant(char)[]] to const(char)[][const(char)[]]
> 
> Why not?
> 
> Since invariant(char)[] can implicitly convert to const(char)[], I
> just don't see a problem with this.



More information about the Digitalmars-d mailing list