|
Boost : |
Subject: Re: [boost] [Container] Provide more guarantees for flat_multimap
From: Niall Douglas (s_sourceforge_at_[hidden])
Date: 2014-08-17 08:03:11
On 17 Aug 2014 at 9:47, Ion Gaztañaga wrote:
> >> I think we should implement the minimal functions in order to improve
> >> the proposal and add it to the standard when possible. Even in the
> >> original proposal, "node_ptr extract(const key_type& x);" seems redundant.
> >
> > Why?
>
> Isn't just a slightly modified "extract(find(k))"? The only difference
> that extract(it) is undefined when passing the end node. I don't know if
> having the extra check is important or the programmer should check
> find() != end() before using extract()
For a concurrent_unordered_map, extract(key) is rehash safe while
extract(iterator) is not. Indeed, anything which uses an iterator is
rehash unsafe, for obvious reasons.
Niall
-- ned Productions Limited Consulting http://www.nedproductions.biz/ http://ie.linkedin.com/in/nialldouglas/
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk