A bug in my code

Sergey Gromov snake.scaly at gmail.com
Mon Sep 8 04:10:41 PDT 2008


Manfred_Nowak <svv1999 at hotmail.com> wrote:
> Sergey Gromov wrote:
> 
> > You can always use
> >   return cast(T[])mem;
> 
> I doubt this, because that `cast' might not be valid for all types `T'.

Could you explain your point in a bit more detail?  std.gc.malloc() is 
guaranteed to return a memory block with alignment requirements 
sufficient for any type.


More information about the Digitalmars-d-learn mailing list