Casting Structs

Timon Gehr via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Jun 1 05:42:38 PDT 2014


On 06/01/2014 09:59 AM, Philippe Sigaud via Digitalmars-d-learn wrote:
> On Sun, Jun 1, 2014 at 12:34 AM, Timon Gehr via Digitalmars-d-learn
> <digitalmars-d-learn at puremagic.com> wrote:
>
>> This behaviour is independent of templates. Struct values of the same size
>> can be reinterpret-cast to each other this way even if their types are
>> completely unrelated.
>
> Do you know if this is by design?
>

Well, it had to be explicitly implemented. The behaviour contradicts the 
documentation at http://dlang.org/expression#CastExpression though.


More information about the Digitalmars-d-learn mailing list