Boost logo

Boost :

From: Joseph Gottman (joegottman_at_[hidden])
Date: 2001-01-11 21:44:52


----- Original Message -----
From: "Matthew Austern" <austern_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Thursday, January 11, 2001 3:40 PM
Subject: [boost] Hash tables and singly linked lists

>
> There's another defensible option, though. Internally we
> still have something like insert-after semantics, but
> externally it looks like ordinary insert-before. The way
> this works is that, internally, an slist iterator that
> refers to an element will point to the *previous* list node.
> You'll be changing iterator dereference from something like
> *(p->val) to something like *(p->next->val).

   One problem with this idea that you didn't mention is that under this
scheme insertions and deletions would invalidate iterators. If a new object
gets inserted after p, then (*p->next->val) suddenly points to a different
object.

Joe Gottman


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