#include #include #include #include #include using namespace std; using namespace boost; using namespace boost::multi_index; class A; class B; class A { public: #ifdef USE_LIST list::iterator b_it; #else multi_index_container>>::iterator b_it; #endif int val; }; class B { public: list::iterator a_it; int val; }; int main() { list la; #ifdef USE_LIST list lb; #else multi_index_container>> lb; #endif A a; a.val = 5; B b; b.val = 7; la.push_front(a); lb.push_front(b); a = la.front(); a.b_it = lb.begin(); cout << a.b_it->val << "\n"; return EXIT_SUCCESS; }