#include #include using namespace boost::intrusive; using namespace std; typedef avl_set_base_hook< link_mode, optimize_size > Hook; struct X : public Hook { X(int t) : t(t) {} int t; bool operator<(const X &v) const {return t < v.t;} }; typedef avl_set Set; int main(int argc,char *argv[]) { { X w(2); { X v(2); { Set set; set.insert(v); set.replace_node(Set::s_iterator_to(v),w); set.clear(); cout << "destructing set" << endl; } cout << "destructing v" << endl; } cout << "destructing w" << endl; } cout << "bye." << endl; return 0; }