Рет қаралды 411
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 surprising C++ standard views. Even with simple use cases you can easily have:
Unexpected functional behavior
Surprising 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.