All posts in "Boost"

4 Features of Boost HOF That Will Make Your Code Simpler

Published January 15, 2021 - 0 Comments

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 […]

Inserting Values to a Map with Boost.Assign

Published December 3, 2019 - 0 Comments

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> […]

Appending Values to a Vector with Boost.Assign

Published November 29, 2019 - 0 Comments

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 […]

How C++17 Benefits from Boost Libraries, Part Two

Published November 22, 2019 - 0 Comments
boost C++17

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 […]

How C++17 Benefits from Boost Libraries, Part One

Published November 19, 2019 - 0 Comments
boost C++17

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 […]

Introduction to Boost Karma

Published February 23, 2018 - 1 Comment

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 […]

Introduction to Boost Phoenix

Published January 26, 2018 - 7 Comments
Boost Phoenix

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 […]