new_array_list Subroutine

public subroutine new_array_list(self, n)

Constructor for the storage data structure

Arguments

Type IntentOptional Attributes Name
type(toml_array_list), intent(out) :: self

Instance of the structure

integer, intent(in), optional :: n

Initial storage capacity


Source Code

subroutine new_array_list(self, n)

   !> Instance of the structure
   type(toml_array_list), intent(out) :: self

   !> Initial storage capacity
   integer, intent(in), optional :: n

   self%n = 0
   if (present(n)) then
      allocate(self%lst(min(1, n)))
   else
      allocate(self%lst(initial_size))
   end if

end subroutine new_array_list