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

>> Precompiled headers are a terrible solution > Why is this?

Think about it: the header potentially depends on any "define" value defined before the header is processed. If we'd have modules that define interfaces that don't depend on macros, we can process all the definitions that make the module only once for all the obj files that depend on it.

You typically don't need conditionals on if another module is used or not. You need conditionals to compile the whole application or the dynamic library some specific way, but that is also only once per the compilation of the whole application.

At the moment there is really code that can include more times he same header to define different types, but these are extreme use cases, however most of the libraries would gain if they would be defined as "modules" definitions of which can be compiled only once per application build.



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

Search: