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: Anonymous 2012-10-08 5:41

>>6

I just generated assembly output from g++ to confirm. It created a new function each time. I very much like the features of C++ but very disappointed to find this. I wonder how std::array made it into C++ if you can't template its size without bloating.

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