bool operator() ( treap<A> const & a, treap<A> const & b ) const { if( a.empty() ) { if( b.empty() ) return false; return b.highest().sd < ""; } if( b.empty() ) { return a.highest().sd < ""; } return a.highest() < b.highest(); }