Inspection: "Algorithm operation on ranges can be used" - reasoning?
Answered
I'm testing out CLion Nova on a C++20 CMake project of mine. I ran a full project analysis and some of the inspections suggest things like: "Call to `transform` can be replaced with a call to `ranges::transform`".
What I'm curious about is why. What does `ranges::transform` provide over `transform`?
(Also, is there no way to copy the inspection message in the list of inspections?)
Please sign in to leave a comment.
> What does `ranges::transform` provide over `transform`?
It reduces `range.begin(), range.end()` to just `range`, see https://blog.jetbrains.com/wp-content/uploads/2020/09/ranges.gif (https://blog.jetbrains.com/rscpp/2020/09/24/resharper-cpp-2020-3-eap/#cpp_ranges).