Boost logo

Boost :

From: Gavin Lambert (boost_at_[hidden])
Date: 2021-10-19 23:20:52


On 20/10/2021 01:27, Peter Dimov wrote:
>> That said, compiling parts of the same program with different C++
>> standards is asking for trouble. I would expect ODR violations from the
>> standard library in that case.
>
> People do that every day, sometimes without even realizing it.

Any time you're using a system-provided C++ library, you're doing this.
  And that includes system-provided Boost.

It's fairly commonplace to compile an app with a higher C++ standard
than was used for the system libraries, because those tend to be built
with conservative defaults.

The reverse is also possible, but less common, since if a library
requires a higher C++ standard to build itself then this usually means
consumers of the library need at least that or higher too. Still, this
is not guaranteed; a library might be using some features only in its
source files and not its public headers.

And I've seen quite a few libraries where only a subset of source files
are compiled with a higher standard level than the others.

(Things are a bit different here between *nix and Windows. Most *nix
distros designate a One True C++ Compilerâ„¢ for their current release,
including a default C++ standard level and library, and most things are
built to this, so it's easier to rely on prebuilt system libraries.
Whereas on Windows there is no standard C++ compiler or library, so it's
more commonplace to either "build the world" and distribute private
binaries or to rely on the C or COM ABIs instead of the C++ ABI, since
those are more stable.)


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