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

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -