Forcing inlining of delegates and lazy
monkyyy
crazymonkyyy at gmail.com
Mon Aug 31 20:41:16 UTC 2026
On Monday, 31 August 2026 at 20:08:28 UTC, ABrightLight wrote:
>
> I don't think any mixin will be able to do this as cleanly or
> as clearly.
your not saying enough to guess what the hard part is, if I take
you at your word uda file seems like it should work to grab
functions:
```d
--- bar.d
import std;
@"grab":
void sayhi(){
"hi".writeln;
}
void saybye(){
"bye".writeln;
}
--- main.d
import std;
void boilplate(alias F)(){
"runnning ".writeln(F.stringof);
F();
"finished ".writeln(F.stringof);
}
void runbars(){
import bar;
static foreach(F;getSymbolsByUDA!(bar,"grab")){
boilplate!F;
}}
unittest{
runbars();
}
```
More information about the Digitalmars-d
mailing list