Boost logo

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 ())½…Å×µ¸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