@bpr I never said that monomorphization is a harmful language feature. I just 
say that someone needs to be aware of it, and that in some contexts this 
monoporphization is in fact a bad thing.

But in c++ it actually is harmful, because the way c++ deals with templates is, 
to create all required instances **per** compilation unit, and then at link 
time the linker throws all duplicates away. And that I consider as harmful, 
because the same function might get compiled 100 times and then gets thrown 
away 99 times. But the problem here is more on the way how c++ compiles its 
sourcecode, and not on how templates generally work. c++ has the same problem 
with datatypes that are declared in headers. 

Reply via email to