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
Show parent comment
11
u/sphere991 Apr 19 '20
Problem here is that splitting it into an overload set doesn't help anyway. The default argument does give you an answer you don't want, which is bad:
But the overload set doesn't give you an answer at all, which is also bad:
On the other hand, because concepts are expression-based, they work just fine in both cases: