emplace_front: Add an element to the front

emplace_frontR Documentation

Add an element to the front

Description

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

Usage

emplace_front(x, value)

Arguments

x

A CppDeque, CppForwardList, or CppList object.

value

A value to add to x.

Details

The emplace methods only add single elements. Use insert to add multiple elements in one call.

Value

Invisibly returns NULL.

See Also

emplace, emplace_after, emplace_back, insert, pop_front, push_front.

Examples

l <- cpp_forward_list(4:6)
l
# 4 5 6

emplace_front(l, 12L)
l
# 12 4 5 6


cppcontainers documentation built on Sept. 9, 2025, 5:55 p.m.