Cast to left hand side

bearophile via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Nov 9 14:17:33 PST 2014


eles:

> I am also strongly in favor of introducing an "uncast". For 
> example, in C++'x const_cast and in D's cast for removing, for 
> example immutability:
>
> immutable int* p = ...;
> int* q = cast(int*)p;

I think this is supposed to work:

void main() {
     immutable int* p;
     int* q = cast()p;
}

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list