splice_after {cppcontainers} | R Documentation |
Move elements
Description
Move elements from one forward list to another forward list by reference.
Usage
splice_after(x, y, x_position, y_from, y_to)
Arguments
x |
A CppForwardList object to which to add elements. |
y |
A CppForwardList object, of the same data type as |
x_position |
Index after which to insert elements in |
y_from |
Index after which to extract elements from |
y_to |
Index of the last element to extract from |
Details
Indices start at 1, which is also the minimum value permitted. Thus, the current implementation in this package does not allow to move the
first element of y
.
Value
Invisibly returns NULL
.
See Also
Examples
x <- cpp_forward_list(4:9)
x
# 4 5 6 7 8 9
y <- cpp_forward_list(10:12)
y
# 10 11 12
splice_after(x, y, 3, 1, 3)
x
# 4 5 6 11 12 7 8 9
y
# 10
[Package cppcontainers version 1.0.0 Index]