Hi all,
Is there a better way of copying the lines of 4 two dimension vectors?
The idea is to copy the contents of line X from v1 to v2, v2 to v3, v3 to v4 and v4 to v1.
I'm using to two aux variables and then calling std::copy, something like below:
Thanks in advance!Code:std::vector v1 (3,std::vector<int> >(3,1)); std::vector v2 (3,std::vector<int> >(3,2)); ... and so on std::vector<int> aux0; std::vector<int> aux1; aux0 = v2[0]; std::copy(v1[0].begin(),v1[0].end(),v2[0].begin()); aux1 = v3[0]; std::copy(aux0.begin(),aux0.end(),v3[0].begin()); aux0 = v4[0]; std::copy(aux1.begin(),aux1.end(),v4[0].begin()); std::copy(aux0.begin(),aux0.end(),v1[0].begin());



LinkBack URL
About LinkBacks



