I tried to write a function to do whatever to a series of data.
//For stl containers
template<typename T>
void foo(T x){
for(auto iter=x.begin();iter!=x.end();++iter)
do_something(*iter);
}
This function was designed to operate STL containers and it's OK. But I want another version for C-array. So I tried this:
//For C-array
template<typename T,size_t N>
void foo(T x[N]){
//blabla
}
//Error
I've read "Partial template specialization for arrays"(and several another related post), but it's for class template. And I also know that when you're specializing a function template, you are actually overloading it. Anyway, the solution in that post can't be implemented here.
Any (or maybe no) way could I do this? :-) Thx for tolerating my poor English and thx for your helps.