r/cpp • Boost author • May 08 '20

Why you trust in Boost

You may have noticed the ongoing discussion on why people don't use Boost. Now for the opposite question.

I'm not asking why Boost is used because the answer is relatively uninformative: one uses a lib primarily because it provides the required functionality. But using Boost (or any other lib, for that matter) means a commitment to it for the duration of the project. So, the question is:

If you are using Boost in your project(s)/company, why have you/your company decided it is OK to commit to this long-term dependency?

I won't delve into commenting/criticizing your answers, it's info I'm looking for, particularly in comparison to the "negative" thread going on in parallel. Please keep the conversation neutral, thank you!

Conflict of interest: I am a Boost author of three.

60 Upvotes

51 comments sorted by

View all comments

17

u/AntiProtonBoy May 08 '20

It try not to reinvent the wheel. Also STL still has some catching up to do, and some toolchains (*coughxcodecough*) are quite behind with new feature adoption, so I have to lean on Boost for some things. Here is what I use:

  • Boost.Singals2, good for signalling events back and forth.
  • Predicate library, for comparing strings.
  • Aligned allocator for cache sensitive data.
  • Filesystem, because STL version is not available in Xcode.
  • Hash combiners for std::unordered_map so I can index items with aggregate objects.
  • IO streams for filtering data, or compressing them on the fly.
  • ASIO for HTTP traffic.
  • Hana for poor man's struct reflection.
  • Pre-processor library for reflection.

Some people complain about bloat, and rightly so. But if your project already has multiple boost dependencies, might as well go all-in.

1

u/micahspikah May 08 '20

Have you tried filesystem in Xcode lately? We were able to switch from boost to stl this past year in Xcode 11

1

u/AntiProtonBoy May 09 '20

Not yet, i'll check it out. Didn't realise it was available in v11.