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

5

u/ArashPartow Apr 19 '20

When your API requires more than 2-3 input parameters - perhaps a context type is more preferable.

Examples: Any of the win32 APIs that end in Ex, ExW or A

Note: I explicitly used the term API and not just any ordinary public interface (eg class etc)