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
7
u/Ameisen vemips, avr, rendering, systems Apr 19 '20 edited Apr 19 '20
Be better if designated initializers allowed arbitrary order.
Also, wouldn't this make the ABI for the function terrible? It's all in a struct, now, so will follow struct-passing rules.
Within a translation unit the compiler can ignore the ABI requirements, but calling a function in another TU...?
Observe: https://godbolt.org/z/Dw9tL8