Boost logo

Boost Users :

Subject: [Boost-users] [multi_index] recursive declaration of MIC with a value which contains references of its kind
From: Nick Stokes (randomaccessiterator_at_[hidden])
Date: 2015-01-26 08:30:20


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).

Any ideas?

Thanks many,
Nick



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