`with (TemplateInstance):` shoild work

Mathias LANG geod24 at gmail.com
Fri Aug 21 06:49:06 UTC 2020


On Friday, 21 August 2020 at 05:10:14 UTC, Andrei Alexandrescu 
wrote:
>
> with (x!()):
>
> void main() {
>     42.fun();
> }
>
> Once that is possible, you get to inject UFCS symbols into a 
> module with ease.

Would the following suit your needs ?

```
template x() {
     void fun(int) {}
}

mixin x;

void main() {
     42.fun();
}
```


More information about the Digitalmars-d mailing list