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/Ameisen vemips, avr, rendering, systems Apr 19 '20

The codegen doesn't change in this situation much for by-value, as the struct is larger than the ABI allows.

Yes, if you only have a few arguments, it will fit. But one of the reasons you want named arguments is for disambiguating many arguments :).

And some people still develop for x86-32 and ARM32, and other architectures.

Also, the default Windows 64-bit ABI requires that any type larger than 64-bits must be passed by reference. Only the SysV ABI allows register passing (and I think the VectorCall ABI).