B
brekehan
mChannelEventQueue is a deque of pointers to ChannelEvent objects
If the first ChannelEvent in the queue is flagged for removal. How can
I iterate through, check for removal flag and remove without getting
error on the 2nd iteration?
// Remove processed events
for(it_event = m_channelEventQueue.begin(); it_event !=
m_channelEventQueue.end(); it_event++)
{
if( (*it_event)->m_processed)
{
delete (*it_event);
m_channelEventQueue.erase(it_event);
}
}
My compiler goves me an error that says "Assertion; Expression: ("this-
after I erase an element, it already is at the end, and then it trys
to increment it. Not sure how to iterate through and delete elements
then...
If the first ChannelEvent in the queue is flagged for removal. How can
I iterate through, check for removal flag and remove without getting
error on the 2nd iteration?
// Remove processed events
for(it_event = m_channelEventQueue.begin(); it_event !=
m_channelEventQueue.end(); it_event++)
{
if( (*it_event)->m_processed)
{
delete (*it_event);
m_channelEventQueue.erase(it_event);
}
}
My compiler goves me an error that says "Assertion; Expression: ("this-
This is a built in assertion I assume. Which is coming up because_Mycont !=0", 0)
after I erase an element, it already is at the end, and then it trys
to increment it. Not sure how to iterate through and delete elements
then...