Iterator confusion

I have a list of pairs of list iterators

like this: std::list< std::pair <std::list<object>::iterator, std::list<object>::iterator> >

If I have an iterator for the top list, what is the correct syntax to dereference one of the iterators in the pair?

(on a related note, I am very happy that the auto feature exists)
Last edited on
If it is the std::list<std::pair<std::list<object>::iterator, std::list<object>::iterator>>::iterator, then you can access the first iterator by it->first and the second iterator by it->second.

To dereference these iterators just put a star in front: *it->first
Last edited on
thank you!
Topic archived. No new replies allowed.