mixin assembler does not work?
sigod via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Sun Jul 20 07:44:05 PDT 2014
On Sunday, 20 July 2014 at 14:18:58 UTC, Foo wrote:
> template Vala(uint count, alias arr) {
> immutable string c = to!string(count);
>
> enum Vala = "asm { sub ESP, " ~ c ~ "; mov " ~ arr.stringof ~
> ",
> " ~ c ~ "; mov " ~ arr.stringof ~ " + 4, ESP; }";
> }
> ...
> mixin Vala!(1000, a);
I'm not sure how to do it, but I see few mistakes in your code:
1. You declaring it as a string. (Or your intend to use
`mixin()`?)
2. You trying to use `template` as a [`mixin template`][0].
[0]: http://dlang.org/template-mixin
More information about the Digitalmars-d-learn
mailing list