Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(ordered), | intent(inout) | :: | this | |||
class(*), | intent(in), | dimension(:) | :: | items | The items to be added to this data structure |
Adds the elements of an array to this object.
gfortran
does not yet support dimension(*) for unlimited
polymorphic variables, so I have had to switch to using
dimension(:)
when compiling with it. This means that only
1D arrays are accepted with gfortran
.Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer, | public | :: | i |
subroutine array_extend(this, items)
!* Author: Chris MacMackin
! Date: February 2016
!
! Adds the elements of an array to this object.
! @Bug `gfortran` does not yet support dimension(*) for unlimited
! polymorphic variables, so I have had to switch to using
! `dimension(:)` when compiling with it. This means that only
! 1D arrays are accepted with `gfortran`.
!
class(ordered), intent(inout) :: this
#ifdef __GFORTRAN__
class(*), dimension(:), intent(in) :: items
#else
class(*), dimension(*), intent(in) :: items
#endif
!! The items to be added to this data structure
integer :: i
do i = 1, size(items)
call this%push(items(i))
end do
end subroutine array_extend