Quote:Hehe, just noticed that "DELETE_ME" is actually taken...
By whom? Also, why all caps?
Quote:if ((iter->second)->DEL_ME == true)
There's no need to compare to true here. Just write:
if (iter->second->DEL_ME)
Quote:iter is an iterator in a multimap. The multimap contains objects with the variable DEL_ME. This keeps returning an exception!
You'll need to be more specific about the errors you're encountering. If you mean an exception is being
thrown, then you need to post the message (if any) associated with the exception, and/or its type (if you know it). If it's an assertion failure, show the actual code that fails. If it's a compile-time error, post the error message along with the code that generates it. If your program is crashing, use the debugger to find out where and why. If it's simply not behaving correctly, describe the incorrect behavior and post the relevant code. And so on.
Quote:What I'm confused about is how do you access the FUNCTIONS and VARIABLES of an object using an iterator.
If the value type of your map is a pointer, then:
iter->second->my_function_or_variable
Is correct.
As for your 'delete me' flag, it's probably not a good idea (at least not as you described it). It's very brittle, and will likely lead to dangling pointers and various other unpleasantries.
An appropriate solution will most likely involve using smart pointers in some way, as mentioned previously. If you want more specific feedback, you may need to provide more information (such as why it's necessary to store the same object in multiple containers, and what these various containers are used for).