Setting a iterator's object to NULL
I created some test code to debug one of my problems, and I think I narrowed it down. One list has shared pointers, the other has addresses of the object pointed to by the shared pointer. When the shared pointer is deleted, it doesn't set the object to NULL so the list full of addresses has some bogus value. Here's some code to explain:
How can I assign a new value to what an iterator is pointing to, or otherwise fix this?
shared_ptr<Enemy> e(new Enemy);
//THIS DOES NOT WORK, but indicates what I want: (*it)=NULL;