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
4
u/georgist Apr 19 '20
I think automatic type conversion for non-built-in types is evil.
If I pass a string to a function that takes a Widget and Widget has a string constructor, why do I ever want that automagically converted?! I know I can avoid this with explicit, but I really don't like this feature.