2
假設我有以下幾點:equal_range上的一個鍵,下升壓的multi_index_container composite_key /上界另一
struct Person
{
std::string mName;
Birthday mBirthday;
};
using namespace boost::mult_index;
typedef multi_index_container<
Person,
ordered_non_unique<
composite_key<
Person,
member<Person, std::string, &Person::mName>,
member<Person, Birthday, &Person::mBirthday>
> // composite_key
> // ordered_non-unique
> PersonContainer; // mult_index_container
PersonContainer personContainer;
...
std::pair<PersonContainer::iterator, PersonContainer::iterator> similarPeople
= personContainer.equal_range(boost::make_tuple("Bob","01/15/65"));
這將使我在哪裏,每個迭代器指向一個名爲Person「鮑勃」天生一個迭代範圍在'01/15/65'上。
如果我想要一個迭代器範圍,它給了我名爲'Bob'的容器中的所有人但是 '01/01/65'和'01/31/65'之間出現?這實際上是'鮑勃'的平等範圍,但生日的上限和下限是相同的。這可能嗎?如果有,請解釋一下如何?
謝謝!