is_allocated Function

private elemental function is_allocated(self)

Arguments

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

Return Value logical


Contents

Source Code


Source Code

   elemental function is_allocated(self)
   !< Return true if the string is allocated.
   !<
   !<```fortran
   !< type(string) :: astring
   !< logical      :: test_passed(2)
   !< test_passed(1) = astring%is_allocated().eqv..false.
   !< astring = 'hello'
   !< test_passed(2) = astring%is_allocated().eqv..true.
   !< print '(L1)', all(test_passed)
   !<```
   !=> T <<<
   class(string), intent(in) :: self     !< The string.
   logical                   :: is_allocated !< Result of the test.

   is_allocated = allocated(self%raw)
   endfunction is_allocated