Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(array_list), | intent(in) | :: | this | |||
procedure(addition_func) | :: | addition | A procedure performing addition between two container objects and returning the result in another container |
A container holding the sum of all of the items held within this list
Returns a container representing the sum of all items contained in the list. This sum is calculated by repeatedly applying the addition procedure to the list's contents.
pure function array_list_sum(this, addition)
!* Author: Chris MacMackin
! Date: March 2016
!
! Returns a [[container]] representing the sum of all items
! contained in the list. This sum is calculated by repeatedly
! applying the addition procedure to the list's contents.
!
class(array_list), intent(in) :: this
procedure(addition_func) :: addition
!! A procedure performing addition between two [[container]]
!! objects and returning the result in another container
class(container), allocatable :: array_list_sum
!! A container holding the sum of all of the items held within
!! this list
end function array_list_sum