Remove and return the last element. ERROR_BOUNDS when empty, in
which case the vector is unchanged.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(vector_int64_t), | intent(inout) | :: | self | |||
| integer(kind=int64), | intent(out) | :: | value | |||
| type(error_t), | intent(inout), | optional | :: | err |
pure subroutine vec_int64_pop_back(self, value, err) !! Remove and return the last element. `ERROR_BOUNDS` when empty, in !! which case the vector is unchanged. class(vector_int64_t), intent(inout) :: self integer(int64), intent(out) :: value type(error_t), intent(inout), optional :: err if (self%n_items <= 0) then call error_raise(err, ERROR_BOUNDS, "vector_int64_t: pop_back on an empty vector.") return end if value = self%items(self%n_items) self%n_items = self%n_items - 1 end subroutine vec_int64_pop_back