Skip to content

Add the sparseRange() utility function

Carsten Gräser requested to merge feature/sparseRange into master

This helper allows to use for-loops with structured bindings for sparse ranges R whose iterators it provide an it->index() method, like this

for(auto&& [A_i, i] : sparseRange(R))
  doSomethingWithValueAndIndex(A_i, i);

This also adds a test and fixes the placement of the range-utilities in the appropriate doxygen group to make them easier to discover.

Merge request reports