typedef std::pair<int, bool> acq_pair; //edge, channel_quality
typedef std::pair<int, acq_pair> ac_pair;
typedef std::multimap<int, acq_pair> ac_map;
typedef ac_map::iterator It_acq;
int bits = acq_map.size();
std::cout << "bits = " << bits << std::endl;
std::vector<std::vector<bool> > c_flags (1 << bits);
for (i = 0; i < c_flags.size(); ++i)
{
for (j = 0; j < bits; ++j)
{
c_flags[i].push_back( (i & (1 << j)) > 0);
}
}
std::cout << "c_flags.size() = " << c_flags.size() << std::endl;
for(i = 0; i < c_flags.size(); ++i)
{
for(j = 0; j < bits; ++j)
{
std::cout << c_flags[i][j] << std::endl;
for(It_acq itc = acq_map.begin(); itc!= acq_map.end(); ++itc)
{
acq_pair it1 = itc->second;
itc->second.second = c_flags[i][j];
std::cout << itc->first << " : " << it1.first << " : " << it1.second << std::endl;
}
}
std::cout << "\n" << std::endl;
}
How can I access only one item from the multimap container at a time? I want to update only the jth value in the map, but when I iterate through the map all the bool values are changed. Is there a selective way to access the map container values?