Learn R Programming

cppcontainers (version 1.0.4)

insert_after: Add elements

Description

Add elements to a forward list by reference.

Usage

insert_after(x, values, position = NULL)

Value

Invisibly returns NULL.

Arguments

x

A CppForwardList object.

values

Values to add to x.

position

Index behind which to insert elements.

See Also

emplace, emplace_after, insert, insert_or_assign.

Examples

Run this code
v <- cpp_forward_list(4:6)
v
# 4 5 6

insert_after(v, 10:11, 2)
v
# 4 5 10 11 6

Run the code above in your browser using DataLab