emplace_after {cppcontainers} | R Documentation |
Add an element
Description
Add an element to a forward list by reference in place.
Usage
emplace_after(x, value, position)
Arguments
x |
A CppForwardList object. |
value |
Value to add to |
position |
Index after which to insert the element. Indices start at 1. The function does not perform bounds checks. Indices outside |
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_back, emplace_front, insert.
Examples
l <- cpp_forward_list(4:6)
l
# 4 5 6
emplace_after(l, 10L, 2)
l
# 4 5 10 6
[Package cppcontainers version 1.0.0 Index]