Actually looking up root is easier than it sounds.
First, you have to write the usual stuff for using boost::intrusive like hooks, etc.
boost::intrusive::avltree<Object> avl;
If you want to lookup a node in any boost::intrusive, you have to use find().
Now, the find() function requires an overloaded () operator that basically checks if $a>b$ or $b < a$ (very much like the boolean output of strcmp), you want this operator to fail at the root node so it will return the root as the results. One way of doing this would be
class RootComp{
bool operator () (const Object &a, const int b) const {
return false;
}
bool operator () (int b, const Object &a) const{
return false;
}
};
Then using find() is straightforward:
int data=0;
boost::intrusive::avltree<Object>::iterator it = avl.find(data, RootComp());
if( it != avl.end() ){
//*it is the root
}else{
// the tree is empty
}