On Monday, January 6, 2020 8:52:01 AM MST Steven Schveighoffer via
Digitalmars-d-learn wrote:
> On 1/6/20 5:07 AM, WebFreak001 wrote:
> > I was wondering, how are you supposed to use std.file : read in @safe
> > code when it returns a void[] but you want to get all bytes in the file?
> >
> > Is vo
On 1/6/20 5:07 AM, WebFreak001 wrote:
Or should void[]
actually be castable to ubyte[] in @safe code?
No, because you can implicitly cast anything to void[], including
pointer arrays.
Possibly const(ubyte[]).
-Steve
On 1/6/20 5:07 AM, WebFreak001 wrote:
I was wondering, how are you supposed to use std.file : read in @safe
code when it returns a void[] but you want to get all bytes in the file?
Is void[] really the correct type it should be returning instead of
ubyte[] when it just reads a (binary) file to
On Monday, 6 January 2020 at 10:07:37 UTC, WebFreak001 wrote:
I was wondering, how are you supposed to use std.file : read in
@safe code when it returns a void[] but you want to get all
bytes in the file?
Is void[] really the correct type it should be returning
instead of ubyte[] when it just
I would say it should return a ubyte[].
On Monday, 6 January 2020 at 10:07:37 UTC, WebFreak001 wrote:
Or should void[] actually be castable to ubyte[] in @safe code?
Definitely not with the current semantics, since a void[] can
alias pointers in @safe code.
See: https://issues.dlang.org/show
I was wondering, how are you supposed to use std.file : read in
@safe code when it returns a void[] but you want to get all bytes
in the file?
Is void[] really the correct type it should be returning instead
of ubyte[] when it just reads a (binary) file to memory? Or
should void[] actually be