Skip to content

Layout tree iterator tools

Louis Moureaux requested to merge feature/layout-tree-iterators into develop


This MR adds tools to facilitate traversal of the layout tree, as described in #42 (closed). Two new syntaxes are introduced:

  • parent.recursive_children() returns a range that comprises all descendants of a node/ I preferred recursive_children to not have functions called children and descendants, which I found confusing.
  • range | filter_nodes<type> (where range is either children() or recursive_children()) returns a new range with only nodes of the given type, returned as references rather than pointers. The pipe syntax is taken from the boost::adaptors library, but I didn't follow its naming convention (would have been filtered_nodes).

Related Issue

Closes #42 (closed).

How Has This Been Tested?

Bundled unit tests.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)


  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
Edited by Laurent Petre

Merge request reports