#Stupid question about array as function argument
1 messages · Page 1 of 1 (latest)
I don't quite understand the question...
do you know how to write the solution in a different language, and we'll translate?
I understand the question?
I don't see why it doesn't work though
what's the error?
If I put it in front it will give me a different error
which error?
that seems like a standard library issue
I could but I wanted to avoid it if possible
well it's better to do that than use @constCast
ok
I intended to use it only in that function as a parameter and don't have it available for the rest of the main function.
but if that's not possible without constCast then I just have to deal with it
I mean you can use constCast if you want but it's not a good look
I doubt that method does modify it
just change the function signature? its in your src
oh, it was as simple at []T => []const T
that's what made me confused at first - seems like this is very similar to std.mem.indexOfAny..?
thanks
Nah, I made that function because the std function can't use strings as needle
yeah, the comparison function you need is different
they'll just compare the pointers and lengths or something...
comparing slices with == is explicitly disallowed, i assume to not misguide people into thinking its a deep comparison
ah, good to know