title: How can I test for the last element in a vector when using BOOST_FOREACH?
body: <p>I have a vector which I iterate over. The final element of the vector is special case, and I'd like to test for it separately. For example, I may do something as such:</p>
  
  <pre><code>for (iterator = vector.begin(); iterator != vector.end(); ++iterator) {
      if ((iterator + 1) == (vector.end())) {
          ...
      } else {
          ...
      }
  }
  </code></pre>
  
  <p>I would like to replace the iterator with the <code>BOOST_FOREACH</code> macro. Can a similar test for the final element be done?</p>