I really like that modern c++ is getting these more functional features but tbh i think they aren't what i'd use here. I Think it's great when some raw loop can be replaced by some more readable desciptive algorithm, even better if it leads to shorter code. But do people really think
24
u/wheypoint Ö Dec 15 '21
Great to see c++20 in action and nice write ups
I really like that modern c++ is getting these more functional features but tbh i think they aren't what i'd use here. I Think it's great when some raw loop can be replaced by some more readable desciptive algorithm, even better if it leads to shorter code. But do people really think
is more readable than the equivalent super simple index or iterator based for loop?
Now maybe in haskell you could solve this using a nice functional composition of simple functions but i think it's too much for c++ ranges.