Boost logo

Boost Users :

Subject: Re: [Boost-users] multi index container
From: joaquin_at_[hidden]
Date: 2010-02-03 10:46:49


Dejan escribió:
>>> Or is a multi_index_container not the right
>>> tool?
>>>
>>>
>> Using Boost.MultiIndex might be overkill here if this is all you need
>> from it: an std::set can be used also with a suitable compare
>> predicate.
>>
> I don't know if finding pointer OR id is possible in a std::set. I've
> tried a std::set with a compare class (which compares pointer and id).
> To store is not a problem but to "container.find(pointer)" AND
> "container.find(id)".
>

OK, if you need to find elements by two different criteria then this is
Boost.MultiIndex is
designed for.

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