Skip to content

Introduce hybrid utilities for homogeneous and heterogeneous containers

Carsten Gräser requested to merge feature/hybrid-utilities into master

These utilities are hybrid in the sense that they work

  • classical and heterogeneous containers
  • dynamical intergers and integral_constants

As a rule of thumb, size and indices are encoded as integral_constant if possible. This allows to write code like

  forEach(integralRange(size(v)), [&](auto i){
    elementAt(v, i) = i+1;
  });

which will e.g. work for std::vector, Dune::BlockVector but also std::tuple and Dune::MultiTypeBlockVector. Another feature is ifElse which provides a hybrid conditional. If passed std::true_type or std::false_type instead of bool this emulates a static_if.

Merge request reports

Loading