E
Evyn
Hi,
How do I compare 2 maps for identical keys, and if they have identical
keys, check if they have identical values? In either case I want to
copy ONLY that key value pair to one of two different maps.
I know how to copy the entire map to another:
// Copy fset1 to fset3
std::copy(fset1.begin(),fset1.end(),std::inserter(fset3,
fset3.begin()));
And I can for example iterate through the entire map, but the key pair
comparison is beyond me at this point.
// Print test
for (std::map<double,double>::const_iterator iter = fset3.begin();
iter != fset3.end(); ++iter )
{
std::cout << iter->first << " , " << iter->second << "\n";
}
Thank you for your time
Evyn
How do I compare 2 maps for identical keys, and if they have identical
keys, check if they have identical values? In either case I want to
copy ONLY that key value pair to one of two different maps.
I know how to copy the entire map to another:
// Copy fset1 to fset3
std::copy(fset1.begin(),fset1.end(),std::inserter(fset3,
fset3.begin()));
And I can for example iterate through the entire map, but the key pair
comparison is beyond me at this point.
// Print test
for (std::map<double,double>::const_iterator iter = fset3.begin();
iter != fset3.end(); ++iter )
{
std::cout << iter->first << " , " << iter->second << "\n";
}
Thank you for your time
Evyn