title: Access Iterator in BOOST_FOREACH loop
body: <p>I have a BOOST_FOREACH loop to iterate over a list. Unfortunately, I also need to cache an iterator to a particular item.</p>
  
  <pre><code>typedef List::iterator savedIterator;
  
  BOOST_FOREACH(Item &amp;item, list)
  {
  // stuff...
    if (condition)
      savedIterator = &amp;item; // this won't work
  
  // do more stuff...     
  }
  </code></pre>
  
  <p>Obviously I can do this using a list.begin()..list.end() for loop, but I've grown to like BOOST_FOREACH. Is there a way round this?</p>