Boost logo

Boost :

Subject: Re: [boost] [Tokenmap] A (perfect) hash container library chcked-in to sandbox (RFC)
From: Slawomir Lisznianski (slisznia_at_[hidden])
Date: 2010-02-22 13:03:57


> Given the very limited interface of tokenmap, you can easily implement in on
> top of
> a std::list, whose iterators do not get invalidated. I think Andrey's
> question is a critical one
> and has not yet been addressed.

Sharing implementation details such as iterators or pointers with
external agents poses safety problems. The tokenmap introduces a
lightweight level of indirection which hides implementation details.
It also decouples the lifecycles of objects (the token can outlive the
pointed to object, say stored in some context, and code can safely
detect that).

You can also think of tokenmap as provider of a "handle", an idiom popular in C.


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