Week 10: Ranges
🔗 Pre-Class Learning Material
A more graphical look at the views available in C++20. Feel free to skip the first 20 minutes.
Treasure trove of range examples: range_by_example. (Thanks @wfpunch!)
Range exercises put together by @cgnitash.
🔗 Conversation Starters/Discussion Questions
- Can you think of an interesting application of composing views? Something with polynomials, prime numbers, images, or anything else?
- Have you ever used lazy evaluation? Do you know of any cases where lazy evaluation can significantly hurt performance? This is one of the first times I’ve seen lazy evaluation in C++; do you know of any other places (libraries or the language) where things are lazy?
- How do you feel about the function call syntax that was shown as an example in the second video? Does this style remind you of any other programming language? How would you like to program in a language where every function began with a return statement?
- Have you ever seen the
type_name()
function shown in the first video? For you template metaprogrammers, do you think it would be useful when debugging your template code?