Jonathan Boccara's blog

Good News for the Pipes Library: pipes::funnel Is Now Gone

Published September 10, 2019 - 0 Comments

Up until now, the pipelines created with the pipes library needed to start with pipes::funnel: myVector >>= pipes::funnel >>= pipes::transform(f) >>= pipes::demux(back_inserter(results1), back_inserter(results2), back_inserter(results3)); pipes::funnel was in the library because I couldn’t see how to implement pipes without it. Several reviewers, including Sy Brand and TH, suggested that the library could be implemented without pipes::funnel. That helped […]

I Don’t Know What You Did Last Summer

Published September 6, 2019 - 0 Comments

Even though the Earth has a little longer to go round in order to click into its Autumn equinox position, for all practical matters summer is now behind us: Summer is a particular time in the year, where we tend to get more time. While the planet is being hurled at an incredible speed from […]

The Demux Pipe

Published September 3, 2019 - 0 Comments
demux pipe C++

The pipes library has gone through an in-depth refactoring to become what it is now, and one of the components that changed the most is the demultiplexer, a.k.a. demux pipe. I think this refactoring illustrates two principles or phenomena that we observe in software refactoring: Single Responsibility Principle and Refactoring breakthrough. They contributed to make […]

How to Disable a Warning in C++

Published August 30, 2019 - 0 Comments

As explained in item 53 of Effective C++, you should “Pay attention to compiler warnings”. In the vast majority of cases, the compiler has a good reason to emit them, and in the vast majority of cases, they point out to an oversight in your code. But in a minority of cases, you may want […]

Extract Function: Should I Extract the Condition Too?

Published August 27, 2019 - 0 Comments

Long functions are hard to read, hard to maintain and hard to understand in their entirety. All in all, they contribute to making our developers lives more difficult. But there is one nice thing about long functions: bashing them down into smaller units to make the code more expressive. This is one of the most […]

How to Make SFINAE Pretty and Robust

Published August 23, 2019 - 0 Comments

Today we have a guest post by Ádám Balázs. Ádám is a software engineer at Verizon Smart Communities Hungary developing video analytics for embedded systems. One of his passions is compile time optimizations so he immediately agreed to write a guest post on this topic. You can find Ádám online on LinkedIn. In the series […]

Making C++ Pipes Compatible with STL Algorithms

Published August 16, 2019 - 0 Comments

As we saw in the previous post, the Smart output iterators are now called Pipes. Pipes allow to write this kind of code: A >>= funnel >>= transform(f) >>= filter(p) >>= unzip(back_inserter(B), demux(back_inserter(C), filter(q) >>= back_inserter(D), filter(r) >>= back_inserter(E)); Which has the plumbing equivalent of this: However, like we required of smart output iterators, we […]

Smart Output Iterators >>= become(Pipes)

Published August 13, 2019 - 0 Comments

What DDD calls a refactoring breakthrough is when after making incremental changes to your codebase you suddenly realize that it would make more sense to represent the domain in a different way. This new point of view allows to make a change on a large scale in the codebase, and that new structure seems to […]