Append an element. If the array is already at capacity the element
is not stored, the size is left unchanged 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(in) | :: | value | |||
| type(error_t), | intent(inout) | :: | err |
pure subroutine fixed_array_int_push_back(self, value, err) !! Append an element. If the array is already at capacity the element !! is *not* stored, the size is left unchanged 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(in) :: value type(error_t), intent(inout) :: err if (self%n_items >= PIC_FIXED_ARRAY_CAPACITY) then call err%set(ERROR_VALIDATION, MSG_OVERFLOW) return end if self%n_items = self%n_items + 1 self%items(self%n_items) = value end subroutine fixed_array_int_push_back