c++ - creating a map from two vectors -


if have 2 stl vectors vect1, vect2 , want produce them map, first element vect1 correspond first element in vect2 , on. how can in simple way?

std::vector<int> a, b; // fill vectors here... std::map<int, int> m; assert(a.size() == b.size()); (size_t = 0; < a.size(); ++i)     m[a[i]] = b[i]; 

Comments

Popular posts from this blog

delphi - TJvHidDeviceController "DevicePath" always showing "\" -

Disabling Android home button for industry application -

asp.net mvc 3 - Unexpected "foreach" keyword after "@" character -