drop is a convenience function which calls
popFrontN(range, n) and returns
range.
Unlike popFrontN, the range argument is passed by copy, not by ref.
drop makes it easier to pop elements from a range rvalue and then pass it to another function within a single expression, whereas popFrontN would require multiple statements.
dropBack provides the same functionality but instead calls
popBackN(range, n)
Note
drop and
dropBack will only pop
up to
n elements but will stop if the range is empty first. In other languages this is sometimes called skip.
Parameters
range | the input range to drop from |
n | the number of elements to drop |
Returns
range with up to n elements dropped