Currently prevector iterators have many issues:
- Forward iterators (and stronger) must be default constructible (https://eel.is/c++draft/forward.iterators#1.2). Otherwise, some functions can not be instantiated, like
std::minmax_element. - Various
constissues with random access iterators. For example, aconst iteratoris different from aconst_iterator, because the first one holds a mutable reference and must also return it withoutconst. Also,operator+must be callable regardless of the iterator object’sconst-ness. - When adding an offset to random access iterators, both
x+nandn+xmust be specified, see https://eel.is/c++draft/random.access.iterators#tab:randomaccessiterator
Fix all issues.
Also, upgrade the std::random_access_iterator_tag (C++17) to std::contiguous_iterator_tag (C++20)