Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(iterator), | intent(in) | :: | this |
Whether there are additional items to iterate through
Returns .true.
if there are any remaining objects through which
to iterate, and .false.
otherwise.
elemental function has_next(this)
!* Author: Chris MacMackin
! Date: March 2016
!
! Returns `.true.` if there are any remaining objects through which
! to iterate, and `.false.` otherwise.
!
class(iterator), intent(in) :: this
logical :: has_next
!! Whether there are additional items to iterate through
has_next = this%location <= size(this%contents)
end function has_next