Currently, most of our custom algorithms (e.g. for_each_pair) take a beginning and ending iterator. Now that we have moved to C++20, they can instead take a single object that matches the range concept. This has the opportunity to simplify many of the call sites. For example, in src/kernels/geometry.cpp, the line
dissolve::transform_reduce(ParallelPolicies::par, mol.species()->torsions().begin(), mol.species()->torsions().end(),
could become
dissolve::transform_reduce(ParallelPolicies::par, mol.species()->torsions(),
Currently, most of our custom algorithms (e.g.
for_each_pair) take a beginning and ending iterator. Now that we have moved to C++20, they can instead take a single object that matches therangeconcept. This has the opportunity to simplify many of the call sites. For example, in src/kernels/geometry.cpp, the linedissolve::transform_reduce(ParallelPolicies::par, mol.species()->torsions().begin(), mol.species()->torsions().end(),could become
dissolve::transform_reduce(ParallelPolicies::par, mol.species()->torsions(),