Boost logo

Boost Users :

Subject: Re: [Boost-users] Boost or Standard when there is the choice?
From: Niall Douglas (s_sourceforge_at_[hidden])
Date: 2014-02-11 15:08:59

On 11 Feb 2014 at 20:23, Paolo Bolzoni wrote:

> I was wondering, what is the best pratice when you can select between
> a standard solution or a boost one?
> For example, std::tie or boost::tie? std::unordered_map or boost::unordered_map?
> Personally I tend to use std solutions, but does it make sense?

A standard library implementation is /probably/ more stable, better
tested and more micro-optimised than Boost *eventually*. I stress the
eventually - right now, C++ 11 standard libraries are still getting
the bugs wringed out of them. but they are settling down and in the
past year certainly I've found bugs more frequently in Boost
implementations of C++11 features than in say Dinkumware's STL.

Regarding the micro optimisation remark, I make this purely based on
my experience with Visual Studio where the Dinkumware implementation
almost always outperforms or is similar to a Boost implementation,
especially in VS2013. This is partially because a Boost
implementation usually has a lot more features and therefore a larger
code footprint, but it's also because Dinkumware do a lot of micro
optimisation once code is known stable.

Lastly, using STL implementations is probably more future proof over
say the next twenty years than using Boost. I can certainly see that
once C++11 is ubiquitous, the incentive to maintain Boost C++11
implementations of standard features will drop substantially. Future
users of your code base will then have to port over code away from
Boost to gain timely access to fixes.

All that said, I still choose Boost.Thread primitives over STL
primitives, mainly due to the much superior feature set and I know
many of those superior features will end up in C++1y, so why wait
till then? Note that I use the namespace mapping technique to map
/some/ implementation into a private namespace, that makes switching
to a STL implementation later fairly trivial.


Currently unemployed and looking for work in Ireland.
Work Portfolio:

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at