array_list_get Function

private pure function array_list_get(this, element)

Arguments

Type IntentOptional AttributesName
class(array_list), intent(in) :: this
integer, intent(in) :: element

The index (starting from 1) of the element to return

Return Value class(container), allocatable

The item with index element. Unallocated if no such element is present.

Description

Returns the item at the specified location in the list. Returns an unallocated container if that location has not been set.


Source Code

  pure function array_list_get(this, element)
    !* Author: Chris MacMackin
    !  Date: March 2016
    !
    ! Returns the item at the specified location in the list. Returns
    ! an unallocated container if that location has not been set.
    !
    class(array_list), intent(in) :: this
    integer, intent(in) :: element
      !! The index (starting from 1) of the element to return
    class(container), allocatable :: array_list_get
      !! The item with index `element`. Unallocated if no such element
      !! is present.
  end function array_list_get