mixins

Abby abby at gmail.com
Wed Nov 17 14:51:58 UTC 2021


Hello I would like to create validation mixin or mixin template 
which would return on error.

Something like this:


```
mixin template Validate(a, b)
{
     if(a > b)
     {
        writeln("invalid input");
        return false;
     }
}

bool test(a,b)
{
     mixin Validate!(a,b);

     ----
     on valid code
     ----

     return true;
}
```



More information about the Digitalmars-d-learn mailing list