Javatpoint Logo
Javatpoint Logo

C++ Deque emplace_front()

C++ Deque emplace_front() function adds a new element to the beginning of the deque container and the size of the container is increased by one.

Syntax

Parameter

val: New value is to be inserted at the beginning of the deque.

Return value

It does not return any value.

Example 1

Let's see a simple example

Output:

strawberry apple mango banana 

In this example, emplace_front() function add two strings i.e apple and strawberry at the beginning of the deque.


Next TopicC++ Deque



Please Share

facebook twitter google plus pinterest