Remove and return the last element. ERROR_BOUNDS when empty, in
which case the vector is unchanged.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(vector_string_t), | intent(inout) | :: | self | |||
| type(string_type), | intent(out) | :: | value | |||
| type(error_t), | intent(inout), | optional | :: | err |
pure subroutine vec_string_pop_back(self, value, err) !! Remove and return the last element. `ERROR_BOUNDS` when empty, in !! which case the vector is unchanged. class(vector_string_t), intent(inout) :: self type(string_type), intent(out) :: value type(error_t), intent(inout), optional :: err if (self%n_items <= 0) then call error_raise(err, ERROR_BOUNDS, "vector_string_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_string_pop_back