String mixin from within a template

ag0aep6g anonymous at example.com
Sun Aug 23 21:13:51 UTC 2020


On Sunday, 23 August 2020 at 20:54:22 UTC, data pulverizer wrote:
> compiled string 1: alias x0 = Remove(indicies[i] - i, Args);
> Error: found - when expecting )
> Error: semicolon expected to close alias declaration
> Error: no identifier for declarator i
> Error: declaration expected, not ,
> ... repeated for the other two cases ...

As the compiler tells you, the line

     alias x0 = Remove(indicies[i] - i, Args);

doesn't parse.

You can't assign the result of a function call to an `alias`.
If `Remove` is indeed a function, you need to use `enum` instead 
of `alias`.
If `Remove` is a template, you're missing an exclamation mark.

You also have a typo: "indicies" should be "indices".


More information about the Digitalmars-d-learn mailing list