Discussion about this post

User's avatar
Yacob Cohen-Arazi's avatar

I love the projection thing in ranges. Once you get used to it (reading/writing the code) it's really nice.

Expand full comment
Tony's avatar

What does the `{}` in the line `auto it = std::ranges::min_element(elements, {}, &Element::v);` refer to?

The documentation states "comparison to apply to the projected elements", however, as a newbie, that is like a foreign language to me.

Ref: https://en.cppreference.com/w/cpp/algorithm/ranges/min_element

Expand full comment
2 more comments...

No posts