Boost logo

Boost Users :

Subject: Re: [Boost-users] Modifying all matching elements in a Boost.MultiIndex Container
From: Joaquin M Lopez Munoz (joaquin_at_[hidden])
Date: 2016-01-01 06:28:51


Amit Prakash Ambasta <amit.prakash.ambasta <at> gmail.com> writes:

> Hey Joaquin
> First of all, thank you so much for your repeated help.

You're welcome. Please don't top post, as suggested by Boost mailing
lists guidelines:

http://www.boost.org/community/policy.html

> In line with the example provided, I've written a generic
> find_and_modify function as:
>
>
>    template <typename T, typename F> Segment*
> find_and_modify(T& iterable, F filters, State s, double a_arr=-1,
> Comment rmk=Comment::INFO_SEGMENT_PREDICTED) {
>     auto iter = iterable.find(filters);
>
>        if (iter == iterable.end())
>         return nullptr;
>
>        std::pair<typename T::iterator, typename T::iterator>
> iteµ…¥¸€ô¥Ñ•É…‰±”¹•ÅÕ…±}É…¹”¡™¥±Ñ•É̤ì(ø€(øƒ
€ƒ
€ƒ
€ƒ
Ý¡¥±”€¡¥Ñ•É}µ…¥¸¹™¥ÉÍЀ„ô¥Ñ•É}µ…¥¸¹Í•½¹¤ì(øƒ
€ƒ
€ƒ
€ƒ
€€€€…ÕѼ¥Ð€ô‰½½ÍÐèéµÕ±Ñ¥}¥¹‘•àèéÁɽ©•Ðñ…Õàø (ø€€€€€€€€€€€€€€€Í•µ•¹Ð°¥Ñ•É}µ…¥¸¹™¥ÉÍФì(øƒ
€ƒ
€ƒ
€ƒ
€ƒ
€ƒ
Í•µ•¹Ð¹•Ðñ…Õàø ¤¹µ½‘¥™ä (øƒ
€ƒ
€ƒ
€ƒ
€ƒ
€ƒ
€€€€¥Ð°(øƒ
€ƒ
€ƒ
€ƒ
€ƒ
€ƒ
€ƒ
€ƒ
l™Ì°€™…}…ÉÈ°€™Éµ­t¡M•µ•¹Ð˜Í•œ¤ì(øƒ
€ƒ
€ƒ
€ƒ
€ƒ
€ƒ
€ƒ
€ƒ
€€€€Í•œ¹ÍÑ…Ñ”€ôÌì(øƒ
€ƒ
€ƒ
€ƒ
€ƒ
€ƒ
€ƒ
€ƒ
€ƒ
€ƒ
¥˜€¡…}…ÉÈ€„ô€´Ä¤(øƒ
€ƒ
€ƒ
€ƒ
€ƒ
€ƒ
€ƒ
€ƒ
€ƒ
€ƒ
€€€€Í•œ¹…}…ÉÈ€ô…}…ÉÈì(ø€(øƒ
€ƒ
€ƒ
€ƒ
€ƒ
€ƒ
€ƒ
€ƒ
€ƒ
€ƒ
¥˜€¡Éµ¬€„ô€­ ½µµ•¹Ðèé%9=}M59Q}AI% Q¤ì(øƒ
€ƒ
€ƒ
€ƒ
€ƒ
€ƒ
€ƒ
€ƒ
€ƒ
€ƒ
€€€€Í•œ¹½µµ•¹Ð€ôÉµ¬ì(øƒ
€ƒ
€ƒ
€ƒ
€ƒ
€ƒ
€ƒ
€ƒ
€ƒ
€ƒ
ô(øƒ
€ƒ
€ƒ
€ƒ
€ƒ
€ƒ
€ƒ
€ƒ
€ô(øƒ
€ƒ
€ƒ
€ƒ
€ƒ
€ƒ
€€¤ì(øƒ
€ƒ
€ƒ
€ƒ
€ƒ
€ƒ
€¥Ñ•É}µ…¥¸¹™¥ÉÍЬ¬ì(øƒ
€ƒ
€ƒ
€ƒ
€ô(ø€(øƒ
€ * *&WGW&â…6VvÖVçB¢’‚b‚¦—FW"’“°£â * *УâÝ  ‹‹ŠN‚•H[œÝÙ\ˆ[ˆÓÈÛÜšÜÈ™XØ]\ÙHHÛÜ\ÈÝ™\ˆH[\™HÙ\]Y[˜ÙB–Ø]^ ˜™YÚ[Š
K]^ ™[™

JH
Ú]]^Z[™›Ü›X][Û—ÛX\Ë™Ù]YØ]^[X\žOŠ
JKÚXÚ\ÈÝX›H[™\ˆ[ÙYšXØ][ÛœÈÙˆH[[Y[È
] ÜÈH˜[™ÛKXXØÙ\Üš[™^
Kˆ\ÈÙ\țݘ[œÛ]HÙ[È[Ý\ˆØÙ[˜\š[ËÚ\™H[ÝH™YY›ÛÜÝ™\ˆHÝXœ˜[™ÙHØKŠHÙˆHÙ\]Y[˜ÙNˆ›Üˆ]ÈÛÜšÈØKŠHÛÝ[š]™HțڙXÝÈH˜[™ÙHØIˉÊH[ˆH]^[™^ ÚXÚÙˆÛÝ\œÙBš\È›ÝHØ\ÙH
˜]™\œØ[Ü™\œÈ\™HY™™\™[
K‚‚ˆIÙ[ÛÈZÙHÈÚ[Ý]][Ý\ˆ\›ØXÚšXBˆ[ÙYžWÝ[œÝX›Wܘ[™ÙH\È\ˆH›ÛÜÝXZ[[™È\ÝÛܚ܏ˆÛÜœ™XÝHÝYÚ
ÝÙ]™\ˆ[ÝIÝ™HÛÛ[Y[Y]]ÛÝ[™HBˆÛÝÙ\ˆ\›ØXÚ
B‚“YX\Ý\™H[™Yˆ\™›Ü›X[˜ÙIÜÈÒÈÝXÚÈÈH[ÙYžWÝ[œÝX›Wܘ[™ÙB˜\›ØXÚ ˆaux index technique can be made to work with a little more
effort (basically, by rearranging the index with rearrange()) but
you might not need to anyway if modify_unstable_range is good enough
(and there's no guarantee it's going to be faster to begin with).

Joaquín M López Muñoz
Telefónica


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