vec_int32_as_array Function

private pure function vec_int32_as_array(self) result(copy)

A copy holding exactly size() elements.

Type Bound

vector_int32_t

Arguments

Type IntentOptional Attributes Name
class(vector_int32_t), intent(in) :: self

Return Value integer(kind=int32), allocatable, (:)


Source Code

   pure function vec_int32_as_array(self) result(copy)
      !! A copy holding exactly `size()` elements.
      class(vector_int32_t), intent(in) :: self
      integer(int32), allocatable :: copy(:)

      allocate (copy(self%n_items))
      if (self%n_items > 0) copy = self%items(1:self%n_items)
   end function vec_int32_as_array