Memory safe in D

Timon Gehr timon.gehr at gmx.ch
Mon Mar 18 21:10:40 UTC 2024


On 3/18/24 13:31, Nick Treleaven wrote:
> 
> ...
>> Related to the above, you may also process an uninitialized value, at 
>> which point anything can happen.
> 
> It can't violate memory safety:

```d
import std.stdio;
void main(){
     bool b = void;
     if(b) writeln("yes");
     if(!b) writeln("no");
}
```


More information about the Digitalmars-d mailing list