Can we just have struct inheritence already?

Timon Gehr timon.gehr at gmx.ch
Thu Jun 13 20:25:59 UTC 2019


On 13.06.19 09:27, Walter Bright wrote:
> On 6/11/2019 7:37 AM, ag0aep6g wrote:
>> The spec very much defines @safe as "no undefined behavior".
>>
>> <https://dlang.org/spec/function.html#function-safety>: "Safe 
>> functions are functions that are statically checked to exhibit no 
>> possibility of undefined behavior."
> 
> The spec's wrong, because it doesn't do that.

Memory safety implies no undefined behavior. The only way the spec can 
be wrong [1] is if you say that corrupting memory has defined behavior 
in D, in which case the spec would be too weak, and not too strong like 
you are implying. Otherwise, "memory safe" and "no undefined behavior" 
are equivalent.


[1] Assuming here that we accept that @safe successfully protects 
against memory corruption, ignoring assumptions that need to be made on 
@trusted functions.


More information about the Digitalmars-d mailing list