Loading…
CppCon 2020 has ended
Thursday, September 17 • 09:00 - 10:00
Pipes: How Plumbing Can Make Your C++ Code More Expressive

Log in to save this to your schedule, view media, leave feedback and see who's attending!

Feedback form is now closed.
In code we work with collections of objects all the time, yet it's not always easy to operate on them with concise and expressive code.

Traversing collections with for loops gets ugly and brittle as soon as they have more than a few lines.
STL algorithms are a big step further, but they don't compose well (ever had the need for a "transform_if" algorithm?)
Ranges are another big step further, but like every library they don't cover all cases (Did you know about the transform-filter performance problem? Or that you're not allowed to use rvalues as inputs? Or that you have to use tuples when working on several collections?)

In this talk you will discover pipes, another way to write expressive code to operate with collections: write your code as plumbing through which your data flows.

Like every library pipes also have their limitations, which we will present, but using them as a complement of ranges and STL algorithms will bring you the following benefits:
- An efficient transform-filter
- zip two collections without using tuples
- send data to several outputs
- use rvalues as inputs and as intermediate results
- pick up the data coming out of STL algorithms
- integrate results in destination containers
- pipes are very easy to implement, so you can add new ones

Come see how pipes can improve your code!

Speakers
avatar for Jonathan Boccara

Jonathan Boccara

Lead Principal Software Engineer, Murex
Jonathan Boccara is a Principal Engineering Lead at Murex where he works on large codebases in C++.His primary focus is searching how to make code more expressive. He has dedicated his blog, Fluent C++, to writing expressive code in C++. He also gives internal trainings on C++ every... Read More →


Thursday September 17, 2020 09:00 - 10:00 MDT
count_if()
  • Algorithms/Functional