Auto keyword with const variable

bearophile bearophileHUGS at lycos.com
Wed Jul 24 03:01:13 PDT 2013


dennis luehring:

> and how would it look to preserve the const if auto would 
> auto-rip it of?

You could write:

immutable j = n;

For every default behavour you need a way to implement the other 
nicely :-)

Currently for the problem of the OP you can use this:

Unqual!(typeof(n)) j = n;

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list