Logical const
Jesse Phillips
jessekphillips+D at gmail.com
Wed Dec 1 11:40:35 PST 2010
so Wrote:
> One another thing i don't quite get is why cast from immutable/const is
> allowed.
> Is it because of the cases that we know the function doesn't change
> anything but still lacks the immutable/const signature?
>
> Thank you!
I believe it is because cast doesn't do any checking. Cast is meant for breaking out of the type system and that is a big selling point for D. This is why casting should be avoided and to! should be used instead.
Thinking about it I think I'll post another thread about opCast.
More information about the Digitalmars-d
mailing list