array_list_min Function

private pure function array_list_min(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 smallest item in the list, as determined by the comparison function

Description

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


Source Code

  pure function array_list_min(this, comparison)
    !* Author: Chris MacMackin
    !  Date: March 2016
    !
    ! Returns the smallest 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_min
      !! The smallest item in the list, as determined by the
      !! `comparison` function
  end function array_list_min