iterator to dereferencing to referencing again
I vaguely remember reading somewhere that this was bad practice, but had to do it just to get around the compiler error:
Let me emphasize that there is no way for me at the moment to get around this. I need to work on the original object later on, and not a copy. That's why I need to pass around a reference.
typedef stl_container<type> A;
typedef different_container<type*> B;
for(A::iterator it = a.begin(); it != a.end(); it++)
b.insert(&(*it)); //dereference, then apply addressof operator again
What's the recommended way of doing this? And why is my kludge(?)workaround(?) discouraged?