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
0
u/germandiago Apr 22 '20
Correct me if I am wrong. If I have this in a library:
export void func(int myParam1, float myParam2);
and now suppose that the parameters are named. This implies that the names must be saved inside the library, occupying some space. If I have 150 such APIs, my binary for the library will be bigger since those names must be stored somewhere. I guess this can create some bloat when linking and using in very constrained environments such as microcontrollers. So there is no runtime overhead but there is binary overhead AFAIK.