Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2003-11-25 19:24:20


"Walker, Daniel" <Daniel.Walker_at_[hidden]> writes:

> template <class T, class Size>
> inline T next_n(T x, Size n)
> {
> std::advance(x, n);
> return x;
> }
>
> template <class T, class Size>
> inline T prior_n(T x, Size n)
> {
> std::advance(x, -n);
> return x;
> }
>
> Is there another way that I'm not aware of that would give me a similar
> effect? If not, is there any interest in next_n() and prior_n()?

Seems reasonable to me, though I'd tend to call them next and prior.

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk