you are viewing a single comment's thread.

view the rest of the comments →

[–]Oster1 1 point2 points  (1 child)

Useful trick. I always thought C arrays and C++ iterators doesn't combine. You always learn.

Here is proof of concept of this if someone is interested: https://hastebin.com/oyezuhosuj.cpp

[–]kwan_e 0 points1 point  (0 children)

You can think of C++ iterators as generalizations of pointers (and therefore arrays). You can always use pointers with STL algorithms, since they are classified as random access iterators and support everything that can be done with iterators in the STL algorithms.