I am looking for an elegant way to pivot a vector of vector prefarably using STL algorithms or boost Sample data looks like this
vector<vector<int> > vm;
vector<int> v;
v.push_back(1);
v.push_back(2);
vm.push_back(v);
v.clear();
v.push_back(3);
v.push_back(4);
vm.push_back(v);
v.clear();
v.push_back(5);
v.push_back(6);
vm.push_back(v);
1 2
3 4
5 6
I want to get a vector of vectors of ints like this
1 3 5
2 4 6