Learn R Programming

cppcontainers (version 1.0.4)

push_front: Add an element to the front

Description

Add an element to the front of a container by reference.

Usage

push_front(x, value)

Value

Invisibly returns NULL.

Arguments

x

A CppDeque, CppForwardList, or CppList object.

value

A value to add to x.

See Also

emplace_front, front, insert, pop_front, push_back.

Examples

Run this code
d <- cpp_deque(4:6)
d
# 4 5 6

push_front(d, 14L)
d
# 14 4 5 6

Run the code above in your browser using DataLab