How is the end()
function implemented in deque-STL of C++ with array?
As per my knowledge it returns past-the-end element. But when a loop is run like, for(i=deq.begin();i!=deq.end();i++)
and the whole array is full (suppose size=4), then I think end()
will point to the position where begin()
is pointing, in this way it won't go in the for loop.
How to resolve this problem?