|
Boost Users : |
Subject: Re: [Boost-users] Pointer to objects in Boost.MultiIndex
From: Joaquin M Lopez Munoz (joaquin_at_[hidden])
Date: 2015-12-30 05:50:37
Amit Prakash Ambasta <amit.prakash.ambasta <at> gmail.com> writes:
>
> Consider the following code snippet:
>
> [...]
>
> struct LinkList;
>
> struct LinkList {
> Â Â size_t index;
> Â Â LinkList* parent;
> Â Â LinkList(size_t index, LinkList* parent) :
> index(index), parent(parent) {}
> };
>
> struct llindex {};
>
> typedef ordered_unique<
> tag<llindex>, member<LinkList, size_t, &LinkList::index>
> > LinkListIndex;
> typedef boost::multi_index_container<
> LinkList, indexed_by<LinkListIndex>
> > IndexedLinkList;
>
> [...]
>
> int main() {
> Â Â IndexedLinkList ill;
> Â Â auto &index_ll = ill.get<0>();
>
> Â Â ill.insert(LinkList{0, nullptr});
> Â Â ill.insert(LinkList{1, (LinkList*)(&(*index_ll.find(0)))});
>  ¥±°¹¥¹Í•ÉС1¥¹1¥ÍÑìÈ°€¡1¥¹1¥ÍШ¤ ˜ ©¥¹‘•á}±°¹™¥¹ À¤¤¥ô¤ì(øƒ
€ƒ
€¥±°¹¥¹Í•ÉС1¥¹1¥ÍÑìÌ°€¡1¥¹1¥ÍШ¤ ˜ ©¥¹‘•á}±°¹™¥¹ Ȥ¤¥ô¤ì(ø€(øƒ
€ƒ
€Í¡½Ü¡¥±°¤ì(øƒ
€ƒ
€É•ÑÕɸ€Àì(øô(ø€(ø€(ø]½Õ±€¡1¥¹1¥ÍШ¤ ˜ ©¥¹‘•á}}±°¹™¥¹¡Ù…±Õ”¤¤¤‰”Ñ¡”É•½µµ•¹‘•Ý…ä(øѼ™•Ñ Ñ¡”Á½¥¹Ñ•ÈѼÁ…É•¹Ðü()•Á•¹‘̽¸Ñ¡”½¹Ñ•áи%˜å½ÔÉ”¥¹Í•ÉÑ¥¹œÑ¡”•±•µ•¹ÑÌ¥¸Í•ÅÕ•¹Ñ¥…°)½É‘•É¥¹œ€¡¤¹”¸Ñ¡”¹•Ý±ä¥¹Í•ÉÑ••±•µ•¹Ð¥Ì±¥¹•Ñ¼Ñ¡”±…Íн¹”¤°)Ñ¡•¸Ñ¡¥Ì¥Ì™…ÍÑ•È…Ìå½Ô‘½¸Ð‘¼…¹ä±½½ÕÀè((€€€…ÕѼ¥Ðõ¥±°¹¥¹Í•ÉС1¥¹1¥ÍÑìÀ°¹Õ±±ÁÑÉô¤¹™¥ÉÍÐì(€€€€€€€€¥Ðõ¥±°¹¥¹Í•ÉС1¥¹1¥ÍÑìÄ°€¡1¥¹1¥ÍШ¤ ˜©¥Ð¥ô¤¹™¥ÉÍÐì(€€€€€€€€¥Ðõ¥±°¹¥¹Í•ÉС1¥¹1¥ÍÑìÈ°€¡1¥¹1¥ÍШ¤ ˜©¥Ð¥ô¤¹™¥ÉÍÐì(€€€€€€€€¥Ðõ¥±°¹¥¹Í•ÉС1¥¹1¥ÍÑìÌ°€¡1¥¹1¥ÍШ¤ ˜©¥Ð¥ô¤¹™¥ÉÍÐì()5…剔å½Ô…¸Áɽ٥‘”ͽµ”µ½É”¥¹™¼½¸Ñ¡”ÁÕÉÁ½Í”F†R7G'V7GW&P§–÷Rw&R'VÆ–F–ær†W&Sò&ö÷7Bä×VÇF”–æFW‚Ö–v‡B†VÇgW'F†W"âf÷ ¦–ç7Fæ6RÂF†—2—2Æ—7BÖÆ–¶R7G'V7GW&RV–6·’6V&6†&ÆR'¦–æFWƒ ¢G—VFVb&ö÷7C£¦×VÇF•ö–æFW…ö6öçF–æW#À¢æöFRÀ¢–æFW†VEö'“À¢6WVVæ6VCÃâÀ¢÷&FW&VE÷Væ—VSÆÖVÖ&W#ÆæöFRÆ–çBÂfæöFS£¦–æFWƒãà¢à¢â–æFW†VDÆ–æ´Æ—7C°¢Bˆˆ[XZ[Š
BˆÂˆ[™^Y[šÓ\Ý[^ÞÌKÌ_KÌŸKÌß_NˆÚÝÊ[
Nˆ™]\›ˆÂˆB‚[ÛËHÚ[\H˜[™ÛWØXØÙ\ÜÈ[™^ZYÚ™HÝY™šXÚY[Yˆ[ÝHÛ›BØ[ÈÛ›ÝÈHÜÚ][ÛˆÙˆH[[Y[[™XØÙ\ÜÈžHÜÚ][Û‚š[ˆÛÛœÝ[[YK‚‚’›Ø\]pë[ˆH0ìÜ^ˆ]pì[Þ‚•[Y°ìÛš
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