Conquering C++20 Ranges - Tristan Brindle - CppCon 2021
Vložit
- čas přidán 30. 05. 2024
- cppcon.org/
github.com/CppCon/CppCon2021
---
This is the final part in a trilogy of talks covering the new Ranges functionality in C++20. Following the format of “C++20 Ranges in Practice” (CppCon 2020), in this installment we’ll look at three more everyday programming problems and discover how Ranges can be used to solve them cleanly, elegantly and concisely. In particular, in this talk we’ll focus on how we can implement our own custom range adaptors, often seen as the “final hurdle” on the road to conquering Ranges. Time permitting, we’ll also take a brief look at the new ranges additions currently in the planning stages for C++23.
---
Tristan Brindle
---
Videos Streamed & Edited by Digital Medium: online.digital-medium.co.uk
Register Now For CppCon 2022: cppcon.org/registration/ - Věda a technologie
Oh man it's awesome!
I was trying to implement the same (fibonacci_view), and was trying to use the “view_interface”, which made me struggle a lot. But failed at the end.
But now I came to know, (says calmly) “it was so simple!”
Thank you so much Mr. Brindle for teaching the adapters, to have our own “views”.
And, Thanks a lot to CppCon as well!
Glad it helped!
An amazing Teacher. I need to watch all his talks.
I was waiting for such a good talk on ranges. Really enjoyed.
Glad to hear!
Just a little correction... it's not std::ranges::unreachable_sentinel_t (or rgn::unreachable_sentinel_t as in the slide) it's std::unreachable_sentinel_t
Great presentation so far! But it looks like we went from 15 lines of 40 lines of code on the exchange example (with the iterator boiler plate). Also the complexity of having to understand cpp20 features + iterators concept.
Brilliant! 👌 👏 😍 👍!
Thank you!
36:19 "What we can't do is call find_if_not and pass std::views::reverse(base_) directly as the first argument..." P2017 should have solved this issue, right?
Ah, I’d forgotten about that change! Yes, I believe you’re correct, apologies for the error 🙂
Time 17.34 in video, couldn't you have used exchange there (you informed us (me!) of it at beginning of video. Would work nicely here, no?
Failed to implement the last example. The rotate seemingly has no effect... Any chance we could get the sources?
Very nice talk, please show your code in git link, We can try play with it.
So is there like a quick recap of all the previous talks from the author? Ranges do seem complicated
Implementation of Adapters do seem complicated, but their usage, feels like absolute POWER!
is there going to be something about functional programming with C++ in this CppCon?
std::exchange is super confusing, it does too many things at once. It smells!
Last example - i think that original version is probably more efficient in terms of speed (but not memory), as we have better memory locality.