
I'm trying to come to grips with using the boost intrusive containers, but I don't think I understand how the lifetime of hooks need to be managed. This piece of code fails the !hook.is_linked() assertion:
Any pointers? Also, is there is a non-intrusive AVL tree container as part of boost?
struct my_node_t {
int i_;
my_node_t(int i): i_(i) {}
friend bool operator<(const my_node_t& lhs, const my_node_t& rhs) {
return lhs.i_ < rhs.i_;
}
friend ostream& operator<< (ostream& os, const my_node_t& n) {
return os << n.i_;
}
};
int main() {
avltree