Converting void* to D array

Steven Schveighoffer via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Apr 15 08:09:32 PDT 2015


On 4/15/15 11:02 AM, CraigDillabaugh wrote:
> Nice.  Thanks.  I didn't realize you can slice a bare pointer like that.
>
> Does druntime have any way of making sure that is safe, or are you on
> your own?

No, druntime cannot know what the pointer actually points at. This would 
not work in @safe code. It's on you to make sure it's valid.

-Steve


More information about the Digitalmars-d-learn mailing list