Mixin operator 'if' directly

Andrey saasecondbox at yandex.ru
Wed Dec 19 13:37:17 UTC 2018


Hi,
Here is a template mixin:
> mixin template create(alias input, uint index, alias data)
> {
>     if(input.length < index) return;
> 
>     // ... some code
> }

When I try to compile it, I get:
> Error: declaration expected, not if

Is it possible to mixin operator 'if' directly inside my template 
mixin?


More information about the Digitalmars-d-learn mailing list