|
Boost Users : |
Subject: [Boost-users] [multi_index] Announcing preview of ranked indices
From: Joaquin M Lopez Munoz (joaquin_at_[hidden])
Date: 2015-04-22 15:34:04
Hi,
It's been 11 years since first proposed, but here it is at last. I'm
releasing a prereview of ranked indices for Boost.MultiIndex:
struct person
{
int age;
std::string name;
};
typedef multi_index_container<
person,
indexed_by<
ranked_non_unique<member<person,int,&person::age> >,
ordered_non_unique<member<person,std::string,&person::name>>>>
multi_t;
multi_t m={{40,"Joe"},{25,"Jill"},{30,"Kurt"},{32,"Sue"}};
auto it=m.emplace(31,"Maggie").first;
std::cout<<m.rank(it)<<" persons younger than "<<it->name<<"\n";
auto n=m.size()/2;
std::cout<<n<<" persons are less than "<<m.nth(n)->age<<" years old\n";
Ranked indices add a bunch of extra rank-related capabilities to the
interface of ordered i¥Ì¸Q¡É
¹¬½
¸±µ¹Ð¥Ì¥Ñ̹յɥ
°)Á½Í¥Ñ¥½¸¥¸Ñ¡¥¹à¸¹Ñ ¡¤¤ÉÑÕɹÌ
¸¥ÑÉ
ѽÈѼѡ±µ¹ÐÝ¥Ñ )É
¹¬¤°Ý¡É
ÌÉ
¹¬¡¥Ð¤¥ÌÑ¡¥¹ÙÉͽÁÉ
Ñ¥½¸¸ ½Ñ áÕÑ¥¸)±½¡¸¤Ñ¥µ¸()¥Ñ¥½¹
±±ä°Ñ¡µµÈչѥ½¹Ì((¥¹}É
¹¬(±½ÝÉ}½Õ¹}É
¹¬(ÕÁÁÉ}½Õ¹}É
¹¬(ÅÕ
±}É
¹}É
¹¬(É
¹}É
¹¬()¡
Ù
ÌÑ¡¥È}É
¹¬µ±Í̽չÑÉÁ
ÉÑÌáÁÐÑ¡äÉÑÕɸÉ
¹ÌÉ
Ñ¡È)Ñ¡
¸¥ÑÉ
ѽÉ̸()=¹É
Ý
¬½É
¹¥¹¥ÌÝÉнÉÉ¥¹¥Ì¡½Ñ¡ÈÑ¡
¸Ñ¡¥È)ͱ½ÝÈÁɽµ
¹
¹¡¥¡Èµµ½Éä½¹ÍÕµÁÑ¥½¸¤¥ÌÑ¡
бѥ½¸½)±µ¹Ñ̥̱½¡¸¤¡¥¸½ÉÉ¥¹¥Ì¥Ð¥Ì½¹ÍÑ
¹ÐÑ¥µ¤¸()½Ý¹±½
±¥ÁÉÙ¥Üè¡ÑÑÀ輽ѥ¹åÕÉ°¹½´½µÝ¬áÄ)QÕѽɥ
°è¡ÑÑÀ輽ѥ¹åÕÉ°¹½´½ÄÌÙåÜ)Iɹè¡ÑÑÀ輽ѥ¹åÕÉ°¹½´½ÁÙ½Õ±È()½ÈÁ½Á±¥¹ÑÉÍÑ¥¸Ñ¡¥Ì°$&V6FRb÷R6÷VÆBF÷væÆöBFP§6÷W&6RÂ6÷BöâF÷öb&ö÷7BãSãSr6÷VÆBv÷&²2vVÆÂÂÆ&@§vFFRæWrfVGW&RæB&W÷'B÷W"&W7VÇG2âÇ6òÂ÷æöç2öâæÖæp¦&RvVÆ6öÖRâF&vWBfW'6öâf÷"&VÆV6ær2&ö÷7BãSÂ6òvRfP§ÆVçGöbFÖRFòF67W72FRFW6vâ&Vf÷&RB2fæÂà ¥Fæ²÷RÀ ¤¦ö\:ÖâÒÌ;7W¢×\;÷ ¥FVÆVl;6æ6
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