vlc_linux/vlc-3.0.16/modules/gui/skins2/utils/var_tree.cpp
/* find iterator to next ancestor
 * ... which means parent++ or grandparent++ or grandgrandparent++ ... */
find iterator to next ancestor
which means parent++ or grandparent++ or grandgrandparent
find iterator to next ancestor which means parent ++ or grandparent ++ or grandgrandparent
VarTree::Iterator VarTree::next_uncle()
{
    VarTree *p_parent = parent();
    if( p_parent )
    {
        VarTree *p_grandparent = p_parent->parent();
        while( p_grandparent )
        {
            Iterator it = ++(p_parent->getSelf());
            if( it != p_grandparent->m_children.end() )
                return it;
            p_parent = p_grandparent;
            p_grandparent = p_parent->parent();
        }
    }
    return root()->m_children.end();
}
VarTree :: Iterator VarTree :: next_uncle ( ) { VarTree * p_parent = parent ( ) ; if ( p_parent ) { VarTree * p_grandparent = p_parent -> parent ( ) ; while ( p_grandparent ) { Iterator it = ++ ( p_parent -> getSelf ( ) ) ; if ( it != p_grandparent -> m_children . end ( ) ) return it ; p_parent = p_grandparent ; p_grandparent = p_parent -> parent ( ) ; } } return root ( ) -> m_children . end ( ) ; }
find iterator to next ancestor
 ... which means parent++ or grandparent++ or grandgrandparent++ ...
find iterator to next ancestor ... which means parent ++ or grandparent ++ or grandgrandparent ++ ...
/* if we didn't return before, it means that we've reached the end */