Boost logo

Boost Users :

Subject: Re: [Boost-users] [multi_index] modify_key with an iterator to composite_key
From: joaquin_at_[hidden]
Date: 2010-01-27 10:29:00


Christian Holmquist escribió:
>
> On the bright side, index updating has been implemented so as to
> be as fast
> as possible: before relocating an element indices check internally
> whether
> the element remains in place after modification, which is usually
> a cheaper
> operation than brute relocation. In the particular case of a
> hashed index, if modify()
> hasn't touched its key then updating merely invokes a hash call
> and a couple of
> pointer comparisons (not even equality comparison is needed.)
>
>
> Excellent, this is definitely good enough. Will I gain anything by
> choosing
> hashed_non_unique over hashed_unique in this case? Outer code
> guarantees that
> duplicates won't be inserted anyway, so this constraint is implicit in
> my case.

hashed_unique should be marginally better, but again you'd better
profile that
assumption.

Thanks for using Boost.MultiIndex,

Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo


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