r/cpp • • 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

149 comments sorted by

View all comments

Show parent comment

2

u/Xeverous https://xeverous.github.io May 01 '20

I prefer ill-formed code to silent runtime error.

1

u/sphere991 May 01 '20

How do you get a runtime error here?

2

u/Xeverous https://xeverous.github.io May 01 '20

Not in your example. In a hypothetical example where a trait would succeed while at runtime it would so something different.