logoalt Hacker News

zozbot234last Thursday at 10:29 PM1 replyview on HN

You can address the junk problem manually by having generic functions delegate as much of their work as possible to non-generic or "less" generic functions (Where a "less" generic function is one that depends only on a known subset of type traits, such as size or alignment. Then delegating can help the compiler generate fewer redundant copies of your code, even if it can't avoid code monomorphization altogether.)


Replies

andrepdyesterday at 7:41 AM

Isn't something like this blocked on the lack of specialisation?

show 1 reply