|
Boost Users : |
Subject: Re: [Boost-users] [multi_index] recursive declaration of MIC with a value which contains references of its kind
From: Joaquin M Lopez Munoz (joaquin_at_[hidden])
Date: 2015-01-26 09:44:51
Nick Stokes <randomaccessiterator <at> gmail.com> writes:
>
> I have a value type (Foo) which is supposed to contain references to
> some multi_index_container of its type, like so:
>
> struct Foo {
> Â int property1;
> Â int property2;Â
>
> Â Â FooMIC* other; // this (the pointer value) may or may not be
> // indexed upon
>
> };
>
>
> typedef multi_index_container< Foo,Â
> Â indexed_by
> Â Â < sequenced<>
>   , ordered_unique< member<Foo, int, &Foo::property1> >
>
> Â Â , ...
> Â Â >> Â FooMIC;
>
>
> Due to recursive nature of this, I wasn't able to figure out how do
> declare such a thing (other than unsafely using void* references in Foo).Â
Try this:
struct Foo {
int property1;
int property2((ÍÑÉÕн½5%¨½Ñ¡Èì(ôì((ÑåÁµÕ±Ñ¥}¥¹á}½¹Ñ
¥¹Èð(½¼°(¥¹á}äð(ÍÅÕ¹ðø°(½ÉÉ}Õ¹¥ÅÕñµµÈñ½¼°¥¹Ð°½¼èéÁɽÁÉÑäÄøø(ø(ø½½5%
Íì((ÍÑÉÕн½5%é½½5%
Í(ì(ÕÍ¥¹½½5%
Íèé½½5%
Íì(ôì()!Q ())½
Å×µ¸43ÍÁè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