powered by
Access the top element in a container without removing it.
top(x)
Returns the top element.
A CppStack or CppPriorityQueue object.
emplace, pop, push.
s <- cpp_stack(1:4) s # Top element: 4 top(s) # [1] 4 s # Top element: 4
Run the code above in your browser using DataLab