use pre-increment for C++ iterator