array_list_max Function

private pure function array_list_max(this, comparison)

Arguments

Type IntentOptional AttributesName
class(array_list), intent(in) :: this
procedure(comparison_func) :: comparison

A procedure which evaluates whether a container object is less than, equal to, or greater than another

Return Value class(container), allocatable

The largest item in the list, as determined by the comparison function

Description

Returns the largest item contained in the list, as determined using the provided comparison function.


Source Code

  pure function array_list_max(this, comparison)
    !* Author: Chris MacMackin
    !  Date: March 2016
    !
    ! Returns the largest item contained in the list, as determined
    ! using the provided comparison function.
    !
    class(array_list), intent(in) :: this
    procedure(comparison_func) :: comparison
      !! A procedure which evaluates whether a [[container]] object is
      !! less than, equal to, or greater than another    
    class(container), allocatable :: array_list_max
      !! The largest item in the list, as determined by the
      !! `comparison` function
  end function array_list_max