Safety, undefined behavior, @safe, @trusted

Jason House jason.james.house at gmail.com
Thu Nov 5 14:43:43 PST 2009


Walter Bright Wrote:

> Andrei Alexandrescu wrote:
> > Nick Sabalausky wrote:
> >> Sounds great! The lower-grained safeness makes a lot of sense, and I'm 
> >> thrilled at the idea of safe D finally encompassing more than just 
> >> memory safety - I'd been hoping to see that happen ever since I first 
> >> heard that "safeD" only ment memory-safe. 
> > 
> > I can think of division by zero as an example. What others are out there?
> 
> Casting away const/immutable/shared.

I posted in the other thread how casting to immutable/shared can be just as bad. A leaked reference prior to casting to immutable/shared is in effect the same as casting away shared. No matter how you mix thread local and shared, or mutable and immutable, you still have the same undefined behavior



More information about the Digitalmars-d mailing list