Double dereference off of iterator?

Hey, I was just playing around with a deque of class pointers, and I was wondering if there was some cool C++ way of writing the following more easily:

1
2
3
4
5
6
7
for (deque <Foo*> ::const_iterator
     fooey  = foos.begin();
     fooey != foos.end();
   ++fooey)
  {
  (*fooey)->quux();  // Is there some cool way to do double-dereferences?
  }

(I suppose I could just use Boost's for_each...)
How about using boost::ptr_deque?

It's iterators return the elements already dereferenced.
Ooohh, I'll have to check that one out. Thanks!
Topic archived. No new replies allowed.