Boost logo

Boost :

From: Gavin Lambert (boost_at_[hidden])
Date: 2021-06-13 23:43:12


On 11/06/2021 9:17 pm, Rainer Deyke wrote:
> Actually, the standard library is a great example of what I am talking
> about.  A header-only library (B) should not care about the specific
> implementation of the standard library (A) being used by the program
> (P).  There is no link dependency from B to A.  There is a requirement
> from B to P that P must provide /a/ implementation of the C++ standard
> library, but B doesn't care if it is libstdc++ or libc++ or even a
> custom standard library implementation that is part of P and not a
> separate library at all.

It does, however, need to be sure that it is using the same standard
library as P (and with the same settings). Mixing multiple standard
libraries into the same P will only end poorly -- which is usually also
true (but less immediately obvious) when mixing multiple variants of
other single libraries into P.

You're assuming that by not specifying an explicit link from B to the
standard library that it will inherently have the same settings as P.
You're even mostly correct, because the standard library has a bit of
special handling in the build tools.

But this issue is not unique to the standard library, but applies to any
dependency, including ones that you do have to explicitly tell the build
tools about.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk