April 24, 2019 incomplete mixin expression | ||||
---|---|---|---|---|
| ||||
> enum Qaz : wstring > { > One = "один" > } > > template Qwerty(Values...) > { > enum text = "Values[%d]"; > enum args = iota(Values.length).map!(value => format!text(value)).join(','); > > pragma(msg, args); > > alias Qwerty = Alias!(mixin("AliasSeq!(" ~ args ~ ");")); > } > > void main() > { > Qwerty!(10, Qaz.One, "qwerty").writeln; > } Output: Values[0],Values[1],Values[2] onlineapp.d(44): Error: incomplete mixin expression AliasSeq!(Values[0],Values[1],Values[2]); onlineapp.d(54): Error: template instance `onlineapp.toUnderlyingType!(10, "\x3e\x04\x34\x04\x38\x04\x3d\x04", "qwerty")` error instantiating Why mixin is "incomplete"? |
April 24, 2019 Re: incomplete mixin expression | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andrey | On Wednesday, 24 April 2019 at 17:22:42 UTC, Andrey wrote:
>> alias Qwerty = Alias!(mixin("AliasSeq!(" ~ args ~ ");"));
>> }
the inner ; is inappropriate there
fixing that might help
|
Copyright © 1999-2021 by the D Language Foundation