Learn R Programming

cppcontainers (version 1.0.4)

emplace_back: Add an element to the back

Description

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

Usage

emplace_back(x, value)

Value

Invisibly returns NULL.

Arguments

x

A CppVector, CppDeque, 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.

See Also

emplace, emplace_after, emplace_front, insert, pop_back, push_back.

Examples

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

emplace_back(v, 12L)
v
# 4 5 6 12

Run the code above in your browser using DataLab