From: Gavin Lambert (boost_at_[hidden])
Date: 2021-06-08 07:42:07
Mere moments ago, quoth I:
> TLDR: C++ is extremely ODR-prone and libraries are very fragile things.
Another way of putting all this is that libraries that can be configured
between static/shared are mostly fine these days, because the tools have
some blunt hammers that mostly do the right things with them. (But
still bite people on occasion.)
But libraries that can be configured between compiled and header-only
are inherently a "here be dragons" and unless done *really* carefully
(or sufficiently small that they can exist without dependencies of their
own), are best avoided.
Pick one of header-only or compiled, and commit to it. Don't try to
hedge it to configuration, as this will only lead to pain and suffering.
And don't try to be header-only unless all of your dependencies are also
header-only, or you're *really darn sure* that the build tools can unify
the static/shared configuration across the whole program.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk