Re: Cannot copy void[] to void[] in @safe code?

2022-07-08 Thread wjoe via Digitalmars-d-learn
On Friday, 8 July 2022 at 12:26:03 UTC, ag0aep6g wrote: You're allowed to copy from `ubyte[]` to `ubyte[]`. But you're not allowed to copy from `ubyte[]` to `int*[]`, because reinterpreting a bunch of bytes as pointers is not safe. The thing about `void[]` is that it can point to memory that

Re: Cannot copy void[] to void[] in @safe code?

2022-07-08 Thread ag0aep6g via Digitalmars-d-learn
On Friday, 8 July 2022 at 10:58:24 UTC, wjoe wrote: My understanding is that a void[] doesn't have a distinct type but since the length is bytes and not elements this makes me believe that under the hood they are byte arrays - or, rather, managed chunks of memory. How's copying memory without

Cannot copy void[] to void[] in @safe code?

2022-07-08 Thread wjoe via Digitalmars-d-learn
Why is that ? My understanding is that a void[] doesn't have a distinct type but since the length is bytes and not elements this makes me believe that under the hood they are byte arrays - or, rather, managed chunks of memory. How's copying memory without a distinct type different from