vec_string_clear Subroutine

private pure subroutine vec_string_clear(self)

Drop every element but keep the allocated storage, so a vector reused across iterations of an outer loop stops reallocating.

Type Bound

vector_string_t

Arguments

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

Source Code

   pure subroutine vec_string_clear(self)
      !! Drop every element but keep the allocated storage, so a vector reused
      !! across iterations of an outer loop stops reallocating.
      class(vector_string_t), intent(inout) :: self

      self%n_items = 0
   end subroutine vec_string_clear