Vision for the D language - stabilizing complexity?

Shachar Shemesh via Digitalmars-d digitalmars-d at puremagic.com
Wed Jul 13 07:06:34 PDT 2016


On 13/07/16 14:28, Andrei Alexandrescu wrote:
>
> Interesting distinction. We must render the latter undefined but not the
> former. Consider:

Here's the definition I'm proposing:
It is undefined behavior to cast away immutable, const or shared 
modifiers and reference the memory if any other part of the program 
accesses that memory with the modifiers intact.

Examples of behavior that is not undefined:
Affix allocator: Accesses memory that is always accessed as mutable
Intrusive reference counting inside a struct: same deal
Only casting a pointer: no access

Shachar


More information about the Digitalmars-d mailing list