-
February 5th, 2021, 05:29 AM
#1
help with the following code
Hello,
Code:
std::map<int, std::multiset<TACNeighbourData> >::iterator found = m_SiteKeyToNeighbourKeys.find(nTopParentKey);
for (auto sneigh : sNeighbourKeys)
{
if (found != m_SiteKeyToNeighbourKeys.end())
{
// Also check if this cell id is already listed
std::multiset<TACNeighbourData>::iterator result =
std::find_if(found->second.begin(), found->second.end(), find_by_cellkey(sneigh.m_CellKey));
if (result == found->second.end())
{
// no match
found->second.insert(sneigh);
}
}
else
{
std::multiset<TACNeighbourData> temp;
temp.insert(sneigh);
m_SiteKeyToNeighbourKeys.insert(make_pair(nTopParentKey, temp));
}
auto found = m_SiteKeyToNeighbourKeys.find(nTopParentKey);
}
Initially for the first neighbour the m_SiteKeyToNeighbourKeys gets created as found ==end().
But for the next loop also it is getting end().
Could you please kindly help
-
February 5th, 2021, 06:20 AM
#2
Re: help with the following code
Moved to top of forloop works ok..thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|