Strict aliasing in D

deadalnix deadalnix at gmail.com
Sun Jul 28 10:11:34 PDT 2013


On Saturday, 27 July 2013 at 09:03:57 UTC, monarch_dodra wrote:
> On Saturday, 27 July 2013 at 08:58:22 UTC, Walter Bright wrote:
>> On 7/27/2013 1:08 AM, monarch_dodra wrote:
>>> 1. Does strict aliasing apply to slices?
>>
>> I don't know what you mean.
>
> double d;
> uint* p = cast(int*)&d; //unsafe aliasing
>
> vs
>
> double[] d = new double[](1);
> uint[] p = cast(uint[])d; //unsafe aliasing ?

That is the same thing at the end.


More information about the Digitalmars-d mailing list