Inherent code performance advantages of D over C?

Timon Gehr timon.gehr at gmx.ch
Sun Dec 15 03:52:16 PST 2013


On 12/15/2013 02:20 AM, Walter Bright wrote:
> On 12/14/2013 4:36 PM, Timon Gehr wrote:
>> I cannot cast data from my own storage allocator to immutable because the
>> behaviour will be undefined.
>>
>> http://dlang.org/const3.html
>>
>> Is this a documentation bug? What should be the actual rules?
>
> It means it's up to you to ensure it is correct.

Undefined behaviour is a term with a precise meaning. That site says 
that casting a reference to immutable while there are still live mutable 
references to memory reachable by that reference leads to undefined 
behaviour. It is not possible to 'ensure it is correct'.


More information about the Digitalmars-d mailing list