A.Vector.pop_last-exclamation-mark

You're seeing just the function pop_last-exclamation-mark, go back to A.Vector module for more information.

Specs

pop_last!(t(val)) :: {val, t(val)} when val: value()

Removes the last value from the vector and returns both the value and the updated vector.

Raises an A.Vector.EmptyError if empty.

Runs in effective constant time.

Examples

iex> vector = A.Vector.new(1..8)
iex> {8, updated} = A.Vector.pop_last!(vector); updated
vec([1, 2, 3, 4, 5, 6, 7])
iex> {nil, updated} = A.Vector.pop_last!(A.Vector.new()); updated
** (A.Vector.EmptyError) empty vector error