I use the reverse iterator on std::vector and at the following link:
http://www.cplusplus.com/reference/stl/vector/rbegin/
myVector.rbegin() is the last element of the vector. In my case, I actually get the past the end iterator on rbegin() and the first element from rend() . I would expect rend() give me a tetra past the end and rbegin() to give me the last element in the container. I realized that all this is wrong?
Below is my code, nothing special. I set a breakpoint immediately after the assignments, and above is the result that I get in the debugger ( VecDebugCubes is a type definition for std::vector<myStructure> )
VecDebugCubes::reverse_iterator itr = pActiveDebugCubes.rbegin(); VecDebugCubes::reverse_iterator itrEnd = pActiveDebugCubes.rend(); while (itr != itrEnd) { (*itr)->printDebugValues(); ++itr; }
source share