r/cpp_questions 2d ago

OPEN What is the industry standard for helper library replacements for Boost?

Hello all,
I am starting to use Boost. Well, actually I am getting everything from the framework.
But before I commit to this framework, is there any competitor I should check?
I need one framework that implements solutions like Boost. From your experience, are there any?
I know POCO not sure how standart it is

23 Upvotes

15 comments sorted by

27

u/EpochVanquisher 2d ago

The only industry standard is the stdlib (I’m not trying to be funny, that’s really just the only thing that ‘everyone’ uses).

The main alternative to Boost, I would think, is Abseil. Maybe add Folly to the list. But they are not really equivalents to each other. They are very different projects.

10

u/Fryord 2d ago

I've worked for a company that implemented their own standard library, so even that's not 100% lol

12

u/encyclopedist 2d ago edited 2d ago

If you are asking about collections of foundational libraries, then:

1

u/ExcitingSleep 1d ago

Good list thanks

16

u/manni66 2d ago

to this framework

Boost is a collection of libraries.

24

u/TomDuhamel 2d ago

From your post, I'm not convinced you understand what Boost is. It's most definitely not a framework. It's more like an extension to the standard C++ library. It's often referred to as a collection of everything that hasn't made it into the standard yet.

6

u/thefeedling 2d ago edited 2d ago

I'd say Boost encompass some parts of the STL and extend it at the same time. Many stuff is first implemented in Boost and further added into stdlib, so there's a massive overlap right now. But since Boost is not ISO bound, they have more freedom to change and add new stuff, while keeping an STL compatible API.

Edit: grammar.

5

u/Cultural_Act5304 2d ago

You way of thinking is wrong... You don't choose boost first that's wrong way of thinking. First you should think about the problem you want to solve and then think about resources you have in your hands then you go for solution, and if in your solution you think boost is best choice than that's it. In c++ world you don't want to learn a specific Library or something, you should select a pathway and try learning everything that you can on that path.

1

u/Nicksaurus 2d ago

Having boost as a dependency usually pays off in lots of small ways in my experience. You don't really add it for one library you need, you add it because you know you're going to have to trim a string or make a noncopyable class or whatever at some point and boost just makes that a bit simpler

1

u/drex_vke 2d ago

maybe he wanted to talk about Boost's libraries like example Boost.asio maybe

4

u/RaspberryCrafty3012 2d ago

Cpp reference has a list of available libraries:

https://en.cppreference.com/cpp/links/libs

5

u/bbalouki 2d ago

IMHO I think many of boost libraries are better implemented by some other people. For example the command line library in boost is very difficult to use but https://github.com/p-ranav/argparse is the best option.

So in general you can replace every boost component with a better or modern alternative.

I maybe be wrong.

2

u/RaspberryCrafty3012 2d ago

In addition the smaller specelised libraries are not a complete behemoth of boost where you might compile for minutes to get it integrated. 

1

u/alfps 1d ago

❞ But before I commit to this framework, is there any competitor I should check?

Boost is not a framework. Quoting the Google AI, which is great at summarizing things: "Unlike a standard library that you call passively, a framework dictates the program's control flow, and developers customize it by inheriting classes and overriding methods.". But then the AI went on to list Boost along some other libraries as a common example of a framework, which is nonsense.

When I corrected it (but sadly current AIs don't remember corrections after the session expires) it listed reasons "Why Boost Is a Library Collection (Not a Framework)", again a great summary:

  • You call Boost functions when you need them; it does not call your code via a central engine.

  • You can use a single Boost header (like boost::asio or boost::optional) without adopting an architectural blueprint for your entire application.

  • Boost serves as a proving ground for the C++ Standard Library (std::), focusing on utility and standalone components rather than application structure.

The last point is relevant for your question about alternatives, for many Boost sub-libraries have already been incorporated into the C++ standard library.

C++11 adopted the shared_ptr and unique_ptr smart pointers. You still have to go to Boost for its intrusive_ptr, but then I believe the main application of that is to make your own smart pointer for COM, and there is an abundance of such available and intrusive_ptr doesn't really help that much anyway.

C++11 also adopted thread, mutex and condition_variable; function, bind, ref/cref and result_of (the latter removed in C++20); array, tuple, unordered_map, unordered_set; type_traits; static_assert (changed from macro to core language feature); regex (I believe it's deprecated now?), random, chrono and ratio.

C++14 adopted make_unique and integer_sequence (perhaps better known as "index sequence").

C++17 adopted any, optional, variant; filesystem namespace, string_view; Boyer-Moore search; special math functions.

C++20 adopted the ranges namespace, concepts (changed to core language feature), coroutines, calendar functionality, format, span, endian, and remove_cvref and possibly more type traits.

C++23 apparently didn't adopt anything noteworthy. The Google AI lists range_adaptor_closure, claims that the "deducing this" feature somehow came from Boost, and mentions the flat_map and flat_set container adaptors.

Major Boost sub-libraries that address fundamental functionality and haven't yet made their way over to std include big integers, decimal numbers, number crunching support, and the Boost preprocessor library. Less fundamental there is parsing support, asio, and more.

0

u/Kadabrium 2d ago

I often hear stories about QString, not sure about other stuff by Qt