Boost logo

Boost Users :

From: John Harris (john.harris_at_[hidden])
Date: 2003-04-29 05:56:03


--- In Boost-Users_at_[hidden], "Duane Murphy" <duanemurphy_at_m...>
wrote:
> --- At Fri, 25 Apr 2003 17:01:56 -0400, Vincent LaBella wrote:
> >sequence, so I tried
> ><snip>
> >last = tok.begin();
> >advance(last,tok.size()-1); // error size() not defined.
<snip>
> Implementation left as an excercise. (Is there a standard algorithm
that
> might fit well besides for_each()?)

how about: std::advance(first, std::distance(first,last)-1) ?

The only requirement for distance() is that iterators be input
iterators, which tokenizer's are.

jh


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net