WIP: move cleaned-up dune-typetree to dune-common
This is a work-in-progress MR for the inclusion of dune-type into dune-common as decided on the dune developer meeting 2020. It acts as a base of discussion and may be split up into smaller parts if necessary. Some points might be discussed and reverted to previous implementation.
Major changes/cleanup compared to dune-typetree:
- Unification of implementation namespaces to
Impl:: - Replace
Hybrid::ifElsewithif constexpr - Cleanup of recursive implementation of
child()andchildStorage - several unused utilities are removed
-
TreeInfomoved to filetreeinfo.hh -
convert_argutility move toshared_ptr.hhand renamed tocopy_or_wrap - fully static treepath
TreePathremoved - unification of the code style
More cleanup suggestions:
- Remove one of the
Childtypes:typeorType. They refer to the same underlying type. - In PowerNode, CompositeNode, and ProxyNode, we use three types of constructors and
setChildmethods, one for l-value references, one for r-values references and one forshared_ptr. All store the child in ashared_ptr. Maybe one should introduce a corresponding utility function inshared_ptr.hh, let's call itcopy_or_wrap_or_sharethat copies into newshared_ptron const l-value references, wraps into a non-destroyingshared_ptrin case or l-value references, forwards ashared_ptrand moves into a newshared_ptrfor r-value references. (the semantic is slightly different towrap_or_share_or_movethat wraps for const and mutable l-value references)
Edited by Simon Praetorius