nested multimap

Started by
2 comments, last by Pink Horror 10 years, 8 months ago

Hi

in a nested multimap the m_procedure_map shrinks depending the getSids function. Now how to avoid altering the m_procedure_map?

Many thanks

for (multimap<string, ProcedureList>::iterator it2 = m_procedure_map.begin() ; it2 != m_procedure_map.end(); ++it2)
{
it2->second = SDatabase::getSids(msg);
for (ProcedureList::iterator it3 = it2->second.begin(); it3 != it2->second.end(); ++it3)

...

Advertisement

That's because you are assigning the it2->second with the result of getSids. Presumably you want to insert that in the multimap instead?

"Most people think, great God will come from the sky, take away everything, and make everybody feel high" - Bob Marley

yes I need to replace it2->second but am short in ideas on how.

it's declared as:

typedef vector<Procedure*> ProcedureList;

From this tiny snippet of code, it does not look like the contents of your loop are affected by the multimap at all. Each iteration, it's just going to go through whatever getSids returns, which I hope does not change unless msg changes. You're messing up somehow, but unfortunately it doesn't seem like you're very capable of sharing the intent of your code, or formatting in a reasonable fashion, so I doubt you'll get much help.

This topic is closed to new replies.

Advertisement