powered by
Add an element to a forward list by reference in place.
emplace_after(x, value, position)
Invisibly returns NULL.
NULL
A CppForwardList object.
Value to add to x.
x
Index after which to insert the element. Indices start at 1. The function does not perform bounds checks. Indices outside x crash the program.
The emplace methods only add single elements. Use insert to add multiple elements in one call.
emplace, emplace_back, emplace_front, insert.
l <- cpp_forward_list(4:6) l # 4 5 6 emplace_after(l, 10L, 2) l # 4 5 10 6
Run the code above in your browser using DataLab