
26 Feb
2010
26 Feb
'10
1:59 a.m.
I'm wanting to pass a boost::array by reference to a function.
Normally, this isn't a problem. My first approach yielded a compiler
error stating boost::array needs template parameters. When adding the
template parameters (approach 2) the compiler then states boost::array
needs T to be a compile time constant. I want the function to be able
to take different boost::array sizes. Can boost::array be passed by
reference without knowing the size of the array at compile time? Any
help would be great.
Ryan
Approach 1
void extract (boost::array & var) {}
Approach 2
template