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 6:54

>>7
The "size is no concern" attitude doesn't help either.

In either case you should've tried with -Os, as if they'd somehow managed to do such an optimisation, I expect it to be only under -Os. I think C++ compilers should at least enable you to view the "intermediate" C output, so you can spot such inefficiencies quickly.

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