[Issue 18580] std.conv.to!(ubyte[])(void[]) should work

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Mar 13 10:40:42 UTC 2018


https://issues.dlang.org/show_bug.cgi?id=18580

Steven Schveighoffer <schveiguy at yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |schveiguy at yahoo.com

--- Comment #8 from Steven Schveighoffer <schveiguy at yahoo.com> ---
There are 2 possibilities I see for this:

1. It doesn't work, use a cast.
2. It should duplicate the array into a new ubyte array.

Simply doing the cast in std.conv.to is not acceptable, even in @system code,
as it's equivalent to a possibly undefined-behavior inducing cast. to is
supposed to be a "safe" cast.

It may be possible to allow a direct cast to const(ubyte)[].

--


More information about the Digitalmars-d-bugs mailing list