Re: Problem with pointers and iterators

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • joseph  cook

    Re: Problem with pointers and iterators

    On Oct 6, 4:56 pm, Griff Johns <n...@spam.comw rote:
    <snip>
    MyObjectList::i terator it;
    for (it = list.begin(); it != list.end(); ++it) {
       // I used to be able to do this:
       MyObject* p_obj = it;
       Foo(p_obj);
    >

    Besides the fact that std::vector is not sutible to be inherited from
    in this manner, you could get through this by:

    Foo(&(*it)); // Take the address of the de-referenced object

    Joe C
Working...