I’m just trying to get more into stl semantics, and converting old loops over to algorithms where appropriate. I’m having trouble figuring out the best way to transform this loop into a call to copy. Any ideas?
vector< vector<float> > rvec;
const float * r[Max] = ...;
// ...
for (int ri=0; ri<N; ri++)
for (int rj=0; rj<M; rj++)
rvec[ri][rj] = r[ri][rj];
If
rvecitself and each vector inrvecalready has the correct size, then resizing isn’t needed.