why no statements inside mixin teplates?

Andrea Fontana via Digitalmars-d digitalmars-d at puremagic.com
Fri May 12 02:02:25 PDT 2017


On Friday, 12 May 2017 at 08:47:32 UTC, visitor wrote:
> works for me :
> mixin template testBoilerPlate(alias arg, alias expected)
> {
>     auto doit = {
>         import std.format : format;
>         auto got = compute(arg);
>         assert(got == expected, "expected %s got 
> %s".format(expected, got));
>         return true;
>     }();
> }

Another error: you want to invoke mixin with 
testBoilerPlate!(...) not testBoilerPlate();



More information about the Digitalmars-d mailing list