( ).
std::list<int>::const_iterator second = list.begin(),
end = list.end();
if ( second != end )
for(std::list<int>::const_iterator first = second++;
second != end;
++first, ++second)
{
}
, first post-incrementation second, , first, list.begin(), - list.begin()+1.
- , boost next prior, ( ), ( , list ).
template <class Iterator>
Iterator next(Iterator i) // Call by value, original is not changed
{
return ++i;
}
// Implementing prior is left as an exercise to the reader ;o)
, next , , , next(i) end() .
: