When programm execute this private method
map<char*, vector<MAILPACK>>::iterator mit;
vector<MAILPACK>::iterator dit;
for(mit=funcs.begin(); mit!=funcs.end(); mit++) {
TRACE tr;
tr.crc32 = crc32;
strncpy(tr.name, (*mit).first, sizeof(tr.name));
int i = 0;
for(dit=(*mit).second.begin(); dit!=(*mit).second.end(); dit++){
tr.nodes[i++] = dit->dwAddr;
}
}
I get error like: Expression:map/set iterator not incrementable
This function iterate through private map std::map<char*, std::vector<MAILPACK>> funcs;
Where I’m wrong?
Thx
P.S. oh, I found that I didn’t control boundaries when saving addresses into tr.nodes.
But this is not the point…
Some
typedef‘s wouldn’t go astray. And pre-increment your iterators, avoiding useless iterator object copies.I agree with @Chowlett, and think you’re stomping out of your
tr.nodesbounds and over one of your iterators. Since you are instantiating yourTRACEobject during the loop, there is a good chance this is happening. You will usually get theExpression:map/set iterator not incrementableerror when your iterator has been invalidated.Is there any reason you’re
tr.nodesmember can’t be a vector too?I could be wrong, more information always helps.