new_ordered_map Subroutine

public subroutine new_ordered_map(self, n)

Constructor for the storage data structure

Arguments

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

Instance of the structure

integer, intent(in), optional :: n

Initial storage capacity


Source Code

subroutine new_ordered_map(self, n)

   !> Instance of the structure
   type(toml_ordered_map), 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_ordered_map