Boost logo

Boost Users :

From: JOAQUIN LOPEZ MU?Z (joaquin_at_[hidden])
Date: 2006-11-23 14:11:56


----- Mensaje original -----
De: Joseph Turian <turian_at_[hidden]>
Fecha: Jueves, Noviembre 23, 2006 7:34 pm
Asunto: [Boost-users] Iterate over all matching items with
hashed_non_unique
Para: boost-users_at_[hidden]

> I have a boost_multi_index with a hashed_non_unique key.
>
> I understand that if I do a .find() for a particular key, I can
> get a single entry with that key.
> However, I want to iterate over *ALL* the entries with this
> particular key, since there may be several.
> How do I do this?

I think .equal_range() is what you need. This member function
returns a pair of iterators signalling the first and one past
the last element with the given key. You can consult
the reference

http://boost.org/libs/multi_index/doc/reference/hash_indices.html

for further details. HTH,

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