O'Reilly logo

Mastering C++ Programming by Jeganathan Swaminathan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Commonly used APIs in a deque

The following table shows the commonly used deque APIs:

API

Description

at ( int index )

This returns the value stored at the indexed position. It throws the std::out_of_range exception if the index is invalid.

operator [ int index ]

This returns the value stored at the indexed position. It is faster than at( int index ) since no bounds checking is performed by this function.

front()

This returns the first value stored in the deque.

back() 

This returns the last value stored in the deque.

empty()

This returns true if the deque is empty and false, otherwise.

size() 

This returns the number of values stored in the deque.

capacity()

This returns the total capacity ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required