Boost logo

Boost Users :

Subject: Re: [Boost-users] [multi_index_container] Using equal_range with hashed indices
From: Joaquin M LópezMuñoz (joaquin_at_[hidden])
Date: 2015-09-28 02:17:33


Muruganand Karthikeyan <muruthegun <at> gmail.com> writes:

> Hello!
>
> std::equal_range requires that the container be pre-sorted
> (http://www.cplusplus.com/reference/algorithm/equal_range/)
> How does multi-index container handle this scenario with respect
> to hashed non-unique indices.

Hashed indices' equal_range works on sequences that have no
particular order (other than equivalent elements being adjacent),
which is fine because it does *not* use std::equal_range internally
but its own logic (much as, say, std::unordered_set::equal_range).

> The reason I ask is since I'm facing a situation with equal_range.
> Please see below code -
>
> [...]
> typedef UserIdContainer::index<id1_id2>::type IndexById1Id2;
> typedef IndexById1Id2::const_iterator ‘•á å%Å%É}¥Ðì(øÍѐèéÁ…¥Èñ%¹‘•á å%Å%É}¥Ð°%¹‘•á å%Å%É}¥Ðø•¹ÑÉ¥•Ì€ô€(ø€€¥¹‘•á å%Å%È¹•ÅÕ…±}É…¹”¡µ…­•}ÑÕÁ±”¡¥Å}Ù…°°¥É}Ù…°¤¤ì(ø(ø$´Í••¥¹œÑ¡…Ѐ©Í½µ•Ñ¥µ•Ì¨•¹ÑÉ¥•Ì¹™¥ÉÍЁ•ÅÕ…±Ì¥¹‘•á å%Å%È¹•¹ ¤(ø…¹•¹ÑÉ¥•Ì¹Í•½¹‘½•Ì¹½Ð•ÅÕ…°¥¹‘•á å%Å%È¹•¹ ¤¸Q¡”±½½­ÕÀ¥Ì(øÙ…±¥€´µ•…¹¥¹œ$Ù”Ù•É¥™¥•Ñ¡…Ёѡ•É”¥Ì…展…ÍЁ½¹”•¹ÑÉäÝ¡¥ (øÍ¡½Õ±‰”…՝¡Ð‰äÑ¡”•ÅÕ…±}É…¹”¸()É…¹”m„±ˆ¤Ý¡•É”„ôõ•¹…¹ˆ„õ•¹¥Ì¥¹Ù…±¥¸́™…ȁ…́$…¸Í•”°)Ñ¡¥Ìµ•…¹ÌÑ¡…Ð((¨e½Õȁ½‘”¡…́ͽµ•¡½Ü‰É½­•¸Ñ¡”¥¹Ñ•É¹…±Ì½˜Ñ¡”½¹Ñ…¥¹•È°(¨½È ½½Íй5ձѥ%¹‘•à¡…́„‰Õœ¸() …¸å½Ô¥Í½±…Ñ”½¹”…Í”Ý¡•É”å½Ô½‰Í•ÉÙ”Ñ¡”…¹½µ…±½Ṍ‰•¡…Ù¥½È)¥¹Ñ¼„½µÁ±•Ñ”Ñ•ÍЁ͹¥ÁÁ•Ð$…¸Ñ…­”„±½½¬…Ðü()Q¡…¹¬å½Ô())½…Å×µ¸43ÍÁ•è5׎è)Q•±•›͹¥„


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