On Sunday, 12 February 2017 at 03:34:19 UTC, Michael Coulombe
wrote:
Do you have a complete code example that gives your error? I
can't reproduce it (DMD v2.073.0):
int foo(T...)(T vars) {
int i = 0;
foreach(ref v ; vars) {
v = 5;
i += v;
}
return i;
}
void bar
On Saturday, 11 February 2017 at 15:02:11 UTC, error wrote:
On Saturday, 11 February 2017 at 14:43:18 UTC, rikki cattermole
wrote:
Try:
foreach(i, v; vars) {
vars[i] = ...;
}
Perfect! Thanks so much - I wish that hint was in the
documentation for variadic functions, although I guess
On Saturday, 11 February 2017 at 14:43:18 UTC, rikki cattermole
wrote:
Try:
foreach(i, v; vars) {
vars[i] = ...;
}
Perfect! Thanks so much - I wish that hint was in the
documentation for variadic functions, although I guess it
suggests an inefficiency in the compiler - since there wo
On 12/02/2017 3:41 AM, error wrote:
I'm making a serializer that has a variadic write method that takes
arbitrary params
and serializes them; I want to do the same thing with a read method (
pass in your
params by ref, and it populates them with data ) - however, I run into
a compiler
error - "
I'm making a serializer that has a variadic write method that
takes arbitrary params
and serializes them; I want to do the same thing with a read
method ( pass in your
params by ref, and it populates them with data ) - however, I
run into a compiler
error - "cannot be ref" in the foreach state