Understanding the Filter View to use it right

Nicolai M. Josuttis

⏱ 90 minute session
intermediate
16:00-17:30, Wednesday, 17th April 2024
Filtering the elements of a collection is one of the most important applications of dealing with ranges and views.

Unfortunately, the filter view (available since C++20) is one of the most suprising C++ standard views. Even with simple use cases you can easily have: - Unexpected functional behavior - Suprising compile-time errors with cryptic error messages - Fatal runtime errors (without even noticing them)

There are (more or less) good reasons for the design of the filter view. However, for a successful filtering of elements knowing all these pitfalls is key.

Listen and learn things you would not expect but have to know when using the filter views and views in general. The talk will demonstrate all the issues with simple real-work examples and also explain the (more or less wise) motivation for the design.

🏷 C++20
🏷 views
🏷 filter
🏷 ranges

Nicolai M. Josuttis

Nicolai Josuttis (www.josuttis.com) is well-known in the community for his authoritative books and talks. For more than 20 years he has been a member of the C++ Standard Committee. He is the author of several worldwide best-sellers, including: - C++20: The Complete Guide - C++17: The Complete Guide - C++ Move Semantics: The Complete Guide - The C++ Standard Library: A Tutorial and Reference - C++ Templates: The Complete Guide (w/ David Vandevoorde & Doug Gregor)