List iterator not dereferencable?

Could you have a race-condition?

If the list were empty, then I’d expect a problem when trying to dereference begin(), but you check for empty. Do you have another thread adding or removing items from list in parallel?

Your code snippets works for me on VS 2008 (assuming I typedef Counted_message_reader to int).

Leave a Comment