Javatpoint Logo
Javatpoint Logo

C++ List splice()

C++ List splice function transfers the elements from list y into a list container at a specified position and this leads to the altering the sizes of both the list.

Syntax

Parameter

y: It is a list object of same type from which the content is to be transferred.

pos: It defines the position where the elements of y are inserted.

pos1: The element pointed by the pos1 is to be transferred.

(first,last): It defines the range of the elements which are to be transferred.

Return value

It does not return any value.

Example 1

Let's see a simple example

Output:

5 6 7 8 1 2 3 4

Example 2

Let's see a simple example

Output:

9 10 11 12 13

Example 3

Let's see a simple example

Output:

java is a programming language

Next Topicunique() Function



Help Others, Please Share

facebook twitter pinterest