Scope of Mixins

Adam D Ruppe destructionator at gmail.com
Thu Aug 26 16:28:22 UTC 2021


On Thursday, 26 August 2021 at 16:16:55 UTC, DLearner wrote:
> Please confirm that mixins of format:

You really shouldn't use string mixins like this at all. If you 
want to work with a variable, pass the variable itself as an 
argument to the function and use it with regular code instead of 
passing names as strings.

void do_something(alias v)() {
    // use v like a normal variable
}

int a;
do_someting!a; // pass the variable a as an alias so you can use 
it inside



More information about the Digitalmars-d-learn mailing list