Purity with references and pointers

Jonathan M Davis jmdavisProg at gmx.com
Sat Sep 18 18:20:49 PDT 2010


On Saturday 18 September 2010 18:16:31 Jonathan M Davis wrote:
> I don't think that *anything*
> is implicitly convertable to immutable. const yes, but not immutable

Actually, I guess that value types are implicitly convertible to immutable in 
the sense that you can create a new immutable value from them, but you can't 
convert them in the sense that you use a pointer to them where that pointer is a 
pointer to immutable. Reference types are never implicitly convertible to 
immutable though. That's why you have to use idup with arrays.

- Jonathan M Davis


More information about the Digitalmars-d-learn mailing list