Skip to content

Simplify applytotree() and applyToTreePair() implementation

This is now implemented 'by hand' using Dune::Hybrid::. This MR also removes two headers containing only unused implementation details. Notice that this contains/is based on !15 (merged), !16 (merged), and !17 (merged).

All tests in dune-typetree and dune-functions pass for this. The implementation is also straight forward and much easier to understand. But I marked this WIP for several reasons:

  • I never used in(), beforeChild(), afterChild()
  • I never used applyToTreePair().
  • I never used the VisitChild filtering mechanism. I tried to mimic the old behaviour exactly, but I'm not sure if that worked out in all corner cases (see below).
  • The new implementation always passes fully static variants of HybridTreePath because I don't see any difference in this. To be honest, I don't know if using Dune::Hybrid here is more or less costly than the indirections and recursions in the old implementation.
  • I did not check this with dune-pdelab.

That's why the use of VisitChild in the old implementation looks slightly odd to me:

  • It passes the father node with reference qualifier but not const removed.
  • It passed the raw child template parameter of PowerNode/CompositeNode.
  • For a const tree this will be instantiated with const Father but non-const Child
  • For a mutable tree this will be will be instantiated with non-const Father but const Child. (I think my version does not work the same in this case.)
Edited by Steffen Müthing

Merge request reports