Lets look at that simple code.
void foo(int line = __LINE__)() {
debug
writeln(`hello, world `, line);
else
writeln(`hello, world`);
}
void main() {
foo();
foo();
}
So we have in the binary two identical versions of code if we compile it with -release -O -inline.
If the function is big and have been called from many places, then size of binary can increases extremely.
I think it's need to improve frontend a little: check if template parametes not used across the function and then drops it.
Comment #1 by robert.schadek — 2024-12-13T18:10:20Z