On Sunday, 9 February 2014 at 13:14:00 UTC, Dicebot wrote:
On Sunday, 9 February 2014 at 13:11:57 UTC, Jakob Ovrum wrote:
Yes, but a new template instance is not necessarily a problem
at runtime or for the executable size. The contents of the
template instance is all that matters. When the content is a
tiny inlinable function, there is no bloat.
I have investiagted relevant parts of DMD for months. It simply
does not work that way and changing it would require huge
frontend refactoring. Inlining does not affect bloat in DMD at
all. Every instance that is ever mentioned in code will always
make its way to the target binary. You can trivially check it.
It is the linker's job to purge unused code.