Boost logo

Boost Users :

Subject: Re: [Boost-users] [Intrusive] Obtaining end iterator from value reference
From: Ion Gaztañaga (igaztanaga_at_[hidden])
Date: 2013-05-01 07:09:27


El 30/04/2013 3:00, Nat Goodspeed escribió:
> On Apr 29, 2013, at 12:34 PM, Ion Gaztañaga <igaztanaga_at_[hidden]> wrote:
>
>> There is no way to obtain the end node from a node in a circular list, as there is no runtime information stored in the ring that marks the end node.
>
> But with a (non-empty) circular list, can't you just iterate until you return to your starting point?

The iterator does not know which node is the starting point (only the
container stores a pointer to the first node). The iterator only stores
a pointer to the next node, it does not know if the next node is the
last or the first node as it's a circular slist.

Ion


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