4 ms·
> It'll be compiled once for every Cpp file that includes it. but are you going to mmap stuff in all your .cpps ? Most of the time when I use an external libra
by jcelerier 8y ago
> It'll be compiled once for every Cpp file that includes it.
but are you going to mmap stuff in all your .cpps ? Most of the time when I use an external library, it does not get out of a single implementation file, so it being header only does not really make it worse
- paavoova 8y agoYou still have to compile the library each time you recompile whichever source file includes it. If the library had its own source file, you would only have to compile once and link it thereafter. This adds up if you have a lot of header-only libraries in your code base, and the total LoC may very well dwarf your own codebase. This is where precompiled headers come in, but introduce their own downsides.