Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

C++ Template Question

Name: Anonymous 2012-10-07 21:47


template <size_t N>
void print_members(int (&arr)[N]) { ... }


so is C++ going to create a new function for every different sized array I use

Name: Cudder !MhMRSATORI!fR8duoqGZdD/iE5 2012-10-08 8:32

>>9
500KB!? What platform is that?

Statically linked on Windows is 64KB (compare 40KB for a printf()), dynamically linked is 16KB for both, dynlink + custom link options is 2.5KB for the cout and 1.5KB for printf. Cutting out the startup code gets it down to 2KB for the cout and 1KB for the printf. .bss stripping turns the printf one into 636 bytes (mostly header bloat), and 1547 for cout which is still 2.5x bigger. Why MS didn't default to settings which produce the last two sizes is anyone's guess...

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List