Input/Output multiple values from function
jzakiya at gmail.com
Mon Sep 2 16:02:02 UTC 2019
On Sunday, 1 September 2019 at 20:50:42 UTC, Paul Backus wrote:
> On Sunday, 1 September 2019 at 20:42:28 UTC, Jabari Zakiya
>> It still won't compile, with this error.
>> Error: AliasSeq!(modpg, res_0, restwins, resinvrs) is not an
>> lvalue and cannot be modified
>> Here's a gist of the code.
>> Top functions in code with issues are genPgParameters and
> You can't do multiple assignments at once using AliasSeq; you
> have to assign each variable individually:
> auto parameters = genPgParameters(pg);
> modpg = parameters;
> res_0 = parameters;
> restwins = parameters;
> resinvrs = parameters;
There's still are problem When I do this.
auto parameters = genPgParameters(pg);
modpg = parameters;
res_0 = parameters;
restwins = parameters;
resinvrs = parameters;
The compiler says this:
Error: cannot implicitly convert expression
parameters.__expand_field_3 of type uint to shared(uint)
If I comment out the last line the programs compiles (and crashes
when run since all the parameters aren't available).
So why does it accept parameter but not  as they are both
defined the same?
Is this a compiler bug?
I have to say, getting this simple parameter passing to work in D
has been an infuriating experience. :-(
More information about the Digitalmars-d-learn