Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(iterator), | intent(in) | :: | this |
A container with the dynamic type of that used to hold the contents of the iterator. It is a pointer as pointer assignment is the easiest way to hold its "value" in an abstract variable.
Returns a container with the dynamic type of that used to hold the contents of this iterator
pure function contents_type(this)
!* Author: Chris MacMackin
! Date: March 2016
!
! Returns a container with the dynamic type of that used to hold
! the contents of this iterator
!
class(iterator), intent(in) :: this
class(container), pointer :: contents_type
!! A container with the dynamic type of that used to hold the
!! contents of the iterator. It is a pointer as pointer assignment
!! is the easiest way to hold its "value" in an abstract variable.
if (.not. this%filled) return
allocate(contents_type,mold=this%contents(1))
end function contents_type