Change ArrayRef iterator type from pointer to std::iterator
Currently a number of coding bugs are possible when comparing iterators from ArrayRef to those from other std::containers, as ArrayRef::iterator is actual a pointer to the data in the container.
Changing the iterator type would avoid bugs where those iterators are compared to pointers or nullptr, but would add complexity to the code.
Another option would be using std::span for ArrayRef itself but this would either need to be natively implemented or imported from an existing implementation.
Make it more aligned with std::span.
Almost everywhere it wasn't needed anyhow.
Only exception: ternary conditional operator. But there the type
was already explict in all but one case and that one case
(src/gromacs/domdec/distribute.cpp) was confusing because of
multiple implicit conversions.
#2 Updated by Mark Abraham almost 2 years ago
My suggestion is that we fix the ArrayRef iterator (I think that is easy). Then we should get a c++14 std::span like thing into compat, or similar. I did have some WIP on gerrit for a c++11 span some time ago, but by now we'd do better to import a new one.