R/rev.R
rev.Rd
rev provides a reversed version of its argument.
rev
ref_rev(x) # S3 method for class 'Deque' ref_rev(x) # S3 method for class 'Deque' rev(x)
Deque object
Deque
For Deque, an object of class Deque
rev uses copy semantics while ref_rev works by reference, that is, it reverse all elements in place.
ref_rev
base::rev()
d = deque(a = 1, b = 2, 3) rev(d) #> |3, b = 2, a = 1| print(d) #> |a = 1, b = 2, 3| ref_rev(d) #> |3, b = 2, a = 1| print(d) #> |3, b = 2, a = 1|