I have a map and a vector.
I need to loop through the map and see if my vector has a matching record.
I'm using this:
For whatever reason, it doesn't like "itDetailRecords->first "
std::map<std::string, int> mpDetailRecords;
std::vector<nsSVector::csRecord>::iterator startSDV = schooldistinctvector.begin();
while (startSDV != schooldistinctvector.end())
mapval = ((startSDV)->corp + (startSDV)->grade);
this is the part with the problem
std::map<std::string, int>::const_iterator itDetailRecords;
for (itDetailRecords=mpDetailRecords.begin(); itDetailRecords != mpDetailRecords.end(); ++itDetailRecords)
rval = findDesiredValue(schoolsummaryvector, itDetailRecords->first) ;
if (rval == 0)
std::cout << itDetailRecords->first << " not found or found with 0 count."<<std::endl;
else if (rval != itDetailRecords->second)
std::cout << itDetailRecords->first << ":" << rval << " not equal "<< itDetailRecords->second <<std::endl;
and none of these are working. I have sample code that says it should work...but I can't get it to work in my application.