0
reverse custom iterator
Hi Refer code below: https://code.sololearn.com/c52WvnTAR09H I just need same default behavior for reverse iterator as well. I mean for loop on rbegin and rend should also work with ++itr instead of currently working as --itr. How can I do achieve the same?
1 ответ
+ 3
You can use the std::reverse_iterator adaptor
https://code.sololearn.com/cXi4oXTxrtyL/?ref=app
std::reverse_iterator:
https://en.cppreference.com/w/cpp/iterator/reverse_iterator