Boost HOF, standing for Higher Order Functions, is a Boost library offering functions that work on functions. This impressive library provides a lot of advanced components allowing to go a step further into functional programming in C++. In this post, we’ll focus on 4 of the more basic ones (+ a bonus one) that allow […]
Boost.Assign is a library that allows for a natural syntax to add elements to a container: std::vector<int> v; v += 1,2,3,4,5,6,7,8,9,10; We’ve seen how it works with vectors and sets, now we will focus on maps. Indeed, maps don’t work the same way. The following code, despite that it looks nice, doesn’t compile: #include <boost/assign/std/map.hpp> […]
C++11 has simplified the syntax to initialize an STL collection with values. Before C++11 we had to write this: std::vector<int> v; v.push_back(1); v.push_back(2); v.push_back(3); v.push_back(4); v.push_back(5); v.push_back(6); v.push_back(7); v.push_back(8); v.push_back(9); v.push_back(10); Now C++11’s std::initializer_list allows to write that instead: std::vector<int> v = {1,2,3,4,5,6,7,8,9,10}; But what if v is an existing vector, to which we’d like to append […]
Today we have a second guest post by Bartlomiej Filipek. Bartek is a C++ programmer, blogger and author. You can find him on LinkedIn or his blog and also read his book. Last time in our series about Boost and C++17 we covered several features: std::optional, std::variant, std::any and string_view. This time we’ll go through […]
Today we have a guest post by Bartlomiej Filipek. Bartek is a C++ programmer, blogger and author. You can find him on LinkedIn or his blog and also read his book. In today’s article, I’ll show you battle-tested features from the well-known Boost libraries that were adapted into C++17. With the growing number of elements […]
The BooSTL algorithms are what we can call the Boost algorithms which are in the same spirit as those of the STL. They encapsulate operations on collections, and being able to use them allows to write (or re-write) more expressive code. To cover all their contents, we split up the articles of the BooSTL into […]
One good way to extend our knowledge beyond the STL is to learn the Boost STL-like algorithms. I like to call them the BooSTL algorithms. To cover all the contents in this algorithms library, we have chunked up the story into three parts: the BooSTL algorithms on sorting and partitioning, the BooSTL algorithms on searching, […]
The STL features a proud 105 algorithms, but that is by no means all the algorithms there is in C++. There are many ways to extend the STL. One of them is to include the STL-like algorithms that are in Boost, which I like to call the BooSTL algorithms! Just like the STL algorithms, those […]
Following up in the series about learning what’s in Boost, let’s get in Boost Karma, that generates strings in a very, very elaborate manner. Too elaborate? Perhaps. But like most of the Boost libraries, even if you don’t end up using them in your production code, it’s still beneficial to know about them. They push […]
With this video, we’re starting a series about learning what’s in the Boost library. Like I discussed in Getting Inspired by Good Code, it is beneficial to know what is in Boost, either to use it or just to expand your horizons about the C++ language. And Boost can expand them pretty far. Knowing what […]