Hi,
This is a "list iterator" problem I expect it will copy the list
iterator (l_iter) to the caller:
eg.
list<HashMap>:: iterator AcctConfParser: :find_Acct_rule (string i)
{
list<HashMap>:: iterator l_iter;
HashMap::iterat or m_iter;
for (l_iter=macro_l ist.begin(); l_iter!=macro_l ist.end(); l_iter++) {
for (m_iter=l_iter->begin(); m_iter!=l_iter->end(); m_iter++) {
if (m_iter->first == "index") {
if (m_iter->second == i)
return l_iter;
}
}
}
}
This function just return a reference to the caller, how can I make
modification so that the function will make a copy of the l_iter to the
caller?
Thanks
Sam
This is a "list iterator" problem I expect it will copy the list
iterator (l_iter) to the caller:
eg.
list<HashMap>:: iterator AcctConfParser: :find_Acct_rule (string i)
{
list<HashMap>:: iterator l_iter;
HashMap::iterat or m_iter;
for (l_iter=macro_l ist.begin(); l_iter!=macro_l ist.end(); l_iter++) {
for (m_iter=l_iter->begin(); m_iter!=l_iter->end(); m_iter++) {
if (m_iter->first == "index") {
if (m_iter->second == i)
return l_iter;
}
}
}
}
This function just return a reference to the caller, how can I make
modification so that the function will make a copy of the l_iter to the
caller?
Thanks
Sam
Comment