Jonathan Boccara's blog

A new post every Tuesday and Friday morning

10 Code Smells a Static Analyser Can Locate in a Codebase

Published March 26, 2019 - 0 Comments

Today’s guest post is written by Issam Lahlali. Issam is the CppDepend lead developer. He enjoy writing C++ code every day and  he wrote many posts about the C++ code quality. Static analysis is not only about directly finding bugs, but also about finding bug-prone situations that can decrease code understanding and maintainability. Static analysis […]

Generalizing Unordered Named Arguments

Published March 22, 2019 - 0 Comments

Today’s guest post is written by Till Heinzel. Till is a physicist-turned-software developer at Luxion Aps in Denmark, who is very interested in expressive C++ and the growth of the language in a more expressive direction. Till can be found online on LinkedIn. First off, I would like to thank Jonathan for creating FluentCpp and […]


Published March 19, 2019 - 0 Comments

Hey all, Here is a little personal announcement. (be right back) (10 min later) Right, so I was saying, I had a little personal announcement to share with you. (be back in a minute) (2 min later) Right! So, the little announcement is: a couple of days ago, I had a little girl! Her name […]

Performance benchmark: Ranges VS STL algorithms VS Smart output iterators

Published March 15, 2019 - 0 Comments

Ranges, STL algorithms and smart output iterators are three libraries that perform operations on collections and make code more expressive. Even if they have some specificities, like zip for ranges and unzip for smart output iterators for example, as we saw when combining ranges with output iterators, they also share features in common, such as transform and filter. […]

The Demultiplexer Iterator: Routing Data to Any Numbers of Outputs

Published March 12, 2019 - 0 Comments
demux demultiplexer iterator

In a previous post, we explored the partition output iterator, that routes data into two directions according to a predicate: the elements that satisfy the predicate to one side, and those that don’t to another side:

The above code sends the even numbers of inputs to evenNumbers and the odd ones to oddNumbers. But what if we […]

STL Algorithms on Tuples

Published March 8, 2019 - 0 Comments

When you manipulate a collection of objects in C++–which is quite a common thing to do when programming in C++–STL algorithms are your loyal companions to perform operations with expressive code. But the STL algorithms, shipped in the standard library with C++, only apply to collections that are filled at runtime, during the execution of […]

for_each_arg: Applying a Function to Each Argument of a Function in C++

Published March 5, 2019 - 0 Comments

How to apply a function to each of the parameter of another function? For example, consider the following function:

How can we apply a function f to each of the parameters of g? Mixing the code of f with the mechanics of going over all the arguments passed to g makes for code that is hard to […]

Partitioning Data with Output Iterators in C++

Published March 1, 2019 - 0 Comments

A couple of months (or years?) back, we saw that partitioning in the STL meant tidying up data according to a predicate: all that satisfy the predicate in one group, and all that don’t satisfy the predicate in another group: This is what the STL algorithms std::partition (or std::stable_partition to keep the relative order of elements) do:


Is Unzip a Special Case of Transform?

Published February 26, 2019 - 0 Comments

In the Smart Output Iterators library, the unzip output iterator allows to send the various elements contained in tuples or pairs to as many output collections:

This is a way to transpose a collection of lines into a collection of columns. Indeed, after executing the above code, column1 contains {1, 4, 7, 10}, column2 contains {2, […]