mixin template test()
{
pragma(inline, true) // remove this will work
static int zzz()
{
return 0;
}
int dummy = zzz();
}
void f()
{
mixin test!();
}
Trying to link this code gives
error: undefined reference to '_D9onlineapp1fFZ8__mixin13zzzFNbNiZi'
collect2: error: ld returned 1 exit status
Error: linker exited with status 1
Comment #1 by dfj1esp02 — 2018-08-10T14:12:26Z
The reason is that the function is not inlined.
Comment #2 by robert.schadek — 2024-12-13T19:00:13Z