r/cpp • u/anonymous23874 • Apr 19 '20
Default function arguments are the devil
https://quuxplusone.github.io/blog/2020/04/18/default-function-arguments-are-the-devil/
90
Upvotes
r/cpp • u/anonymous23874 • Apr 19 '20
View all comments
8
u/sphere991 Apr 19 '20
I guess Arthur must really hate Ranges?
There, we have algorithms like (this pattern is prolific throughout algorithms):
Which this post claims is "the devil", and should be rewritten like:
Personally, I strongly prefer the former (note that the predicate constraint needs to be spelled differently in each overload). Your mileage may vary.