The difficulty of implementing this iterator is that it requires lots of operator overloads which are usually very simple to implement, but result in a lot of code. The goal of this patch is to abstract the common parts so that it becomes easier to implement random accessor iterators. Many algorithms can work more efficiently with random access iterators than with other iterator types. Also see https://en.cppreference.com/w/cpp/iterator/random_access_iterator Pull Request: https://projects.blender.org/blender/blender/pulls/118113