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
1
u/fransinvodka Apr 19 '20
The problem with strong types is the pollution of the global namespace. If you use them in your program, it's okay. No other user is supposed to use them but yourself. With libraries it's another whole strory. I'm pretty sure the user doesn't want the identifier [nN]ame, for example, in the global namespace.
I'm not aware of a library that doesn't pollute the global namespace and, at the same time, provides that syntactic sugar of strong types. That hints me that a language-level feature is needed there.