vec_string_as_array Function

private pure function vec_string_as_array(self) result(copy)

A copy holding exactly size() elements.

Type Bound

vector_string_t

Arguments

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

Return Value type(string_type), allocatable, (:)


Source Code

   pure function vec_string_as_array(self) result(copy)
      !! A copy holding exactly `size()` elements.
      class(vector_string_t), intent(in) :: self
      type(string_type), allocatable :: copy(:)

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