Javatpoint Logo
Javatpoint Logo

C++ Deque end()

C++ Deque end() function returns an iterator pointing to the "past-the-last" element of deque. If the deque container is empty then the end() function returns the same as the begin() function.

where, past-the-last: The "past-the-last" is the element that follows the last element and it does not point any element.

C++ Deque end()



It does not contain any parameter.

Return value

It returns an iterator referring to the past-the-last element.

Example 1

Let's see a simple example


10 20 30 40 50 

In this example, end() function is used in the while loop to iterate throughout the deque container.

Next TopicC++ Deque

Help Others, Please Share

facebook twitter pinterest