Saturday 15 February 2014

c++ - Check if map contains all the keys from another map -


Answer my question, but I'm not sure how we repeat through two maps at the same time.

I know how to do it again through one:

  typedef std :: map & lt; QString, PropertyData & gt; TagData; TagData original = readFileToMap ("FoxHud.bak"); (TagData :: const_iterator tagIterator = original.begin (); tagIterator! = Original.end (tagIterator ++) {}    

for text if you want to iterate 2 maps at once, you can:

  if (map1.size ())! = Map2.size ()); // Problem Other (for map : const_iterator it1 = map1.begin (), it2 = map2.begin (); it1! = Map1.end () and it2! = Map2.end (); + it1, ++ it2) {// ...}}   

Now if you want to run "speed" again through 2 maps , Then in the loop position it would be more appropriate to increase the increment of 1 and it2 independently. See for example.

No comments:

Post a Comment