Remove and return the last element (LIFO). On an empty array
value is set to zero and err is set to ERROR_VALIDATION.
On success err is left untouched.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(fixed_array_int_t), | intent(inout) | :: | self | |||
| integer(kind=default_int), | intent(out) | :: | value | |||
| type(error_t), | intent(inout) | :: | err |
pure subroutine fixed_array_int_pop_back(self, value, err) !! Remove and return the last element (LIFO). On an empty array !! `value` is set to zero and `err` is set to `ERROR_VALIDATION`. !! On success `err` is left untouched. class(fixed_array_int_t), intent(inout) :: self integer(default_int), intent(out) :: value type(error_t), intent(inout) :: err if (self%n_items <= 0_default_int) then value = 0_default_int call err%set(ERROR_VALIDATION, MSG_UNDERFLOW) return end if value = self%items(self%n_items) self%n_items = self%n_items - 1 end subroutine fixed_array_int_pop_back