free Subroutine

private elemental subroutine free(self)

Arguments

TypeIntentOptionalAttributesName
class(string), intent(inout) :: self

Contents

Source Code


Source Code

   elemental subroutine free(self)
   !< Free dynamic memory.
   !<
   !<```fortran
   !< type(string) :: astring
   !< astring = 'this is string example....wow!!!'
   !< call astring%free
   !< print '(L1)', astring%is_allocated().eqv..false.
   !<```
   !=> T <<<
   class(string), intent(inout) :: self !< The string.

   if (allocated(self%raw)) deallocate(self%raw)
   endsubroutine free