Boost logo

Boost :

Subject: Re: [boost] Some statistics about the C++ 11/14 mandatoryBoost libraries
From: Niall Douglas (s_sourceforge_at_[hidden])
Date: 2015-05-21 08:46:12


On 18 May 2015 at 20:36, Peter Dimov wrote:

> The defining characteristic of the Douglas universe is that the standard
> library now contains the many essential components (tuple, shared_ptr,
> function, bind, type traits, threads, atomics, and so on) that were
> previously only supplied by Boost.
>
> In the pre-Douglas universe, you (the library author) had to rely on their
> Boost implementation, which coupled you to other Boost components, sometimes
> to their specific versions.
>
> In the Douglas universe, you can use the standard library for all that,
> allowing your library to be independent of the rest of Boost.

Let me correct this paragraph:

> In the Douglas universe, you can [choose to use either] the standard
> library [or Boost] for all that, allowing your library to be independent
> of the rest of Boost [because you have formalised the specification of
> its exact dependencies].

An underappreciated part of this is the formal specification of
dependencies. It means you are forced to actively think about what
dependencies you use instead of blithely typing boost::X and
introducing some trivial dependency. Trivial dependencies are too
easy to do in Boost 1.x.

> Even if you use, say, boost::shared_ptr on C++03 compilers, since your
> library uses the interface of std::shared_ptr on C++11, this is a certain
> guarantee that it does not depend on anything specific to a particular
> version of boost::shared_ptr. As long as boost::shared_ptr is standard
> conforming, any version ought to do and upgrading boost::shared_ptr ought to
> not break things.
>
> Hence the idea that libraries can follow their own release schedules.

There are also added benefits in that your code's assumptions about
shared_ptr behaving a certain way get tested.

In AFIO I was not surprised by shared_ptr, but I was quite surprised
by my use of boost::bind => std::bind which did not convert over
identically. The fix was trivial, but I still learned I had been
sloppy.

Niall

-- 
ned Productions Limited Consulting
http://www.nedproductions.biz/ 
http://ie.linkedin.com/in/nialldouglas/



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