You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Consider this function:
void fun(ref char[4]);
You can call it like this:
char[20] buffer;
// pass a slice of buffer as the static array
fun(buffer[10 .. 10 + 4]);
That works as expected, but this doesn't work:
// pass a slice of buffer as the static array with variable offset
int x = 10;
fun(buffer[x .. x + 4]);
This is pretty annoying... only workaround some hideous casting:
fun(*cast(char[4]*)(buffer.ptr + x));
Would be nice for the prior expression to work in @safe code.
The text was updated successfully, but these errors were encountered:
Manu reported this on 2019-05-28T06:12:19Z
Transferred from https://issues.dlang.org/show_bug.cgi?id=19907
CC List
Description
The text was updated successfully, but these errors were encountered: