Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The reason being the compiler needs to know the template code to be able to generate a specialization for it.

ELF files based on the C type system can't provide such information on object files, and binary libraries.

In the modules world it can read it from the symbol table on the BMI, like in any other module based language.



Not sure what ELF and C type system has to do with this. C type information can be stored in ELF (as well as many other things). This is how a debugger can know the types.

It is simply a language design flaw of C++ that class implementation (not just templates) ended up in the headers.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: