3 ms·
I avoid header-only libs like the plague and don't really understand why people prefer them. I mean, I get it, I just don't agree with the tradeoffs. header-o
by RandoHolmes 6y ago
I avoid header-only libs like the plague and don't really understand why people prefer them. I mean, I get it, I just don't agree with the tradeoffs.
header-only slows compilation down just so you can avoid adding in a single line in your build chain of choice. It's just not a trade off worth making imo.
So to me, not being header only is a pro, not a con.
- Mailtemi 6y agoHave you tried "explicit template instantiation"? If the library templates have good separation, you can just add a cpp file so the compiler doesn't need to deduce the type each time.
- RandoHolmes 6y agoyep, that's exactly what I do when I really end up having to use a header-only lib that uses templates. It's not that I'll outright refuse to use a header-only lib, only that I very very strongly prefer not using them.