4 ms·
> This is why a cast to immutable is not allowed in D code marked as @safe. It's an interesting design decision that D code is (presumably) @unsafe by default.
by smegel 12y ago
> This is why a cast to immutable is not allowed in D code marked as @safe.
It's an interesting design decision that D code is (presumably) @unsafe by default.
- WalterBright 12y agoYes, although one can explicitly mark code as @system. (I've never liked the "unsafe" attribute, as it implies the code is actually broken.) Safety is something that becomes more desirable the larger and more complex a program is. I wanted D to also be convenient to use for quick, simple programs without burdening the user with having to add annotations.