subroutinemove_valuepureprivate
pure subroutine move_value(from, to)
Move a value, without copying what it holds.
Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
| from | type(value_t) | inout | the value | |
| to | type(value_t) | inout | where it goes |
Source
Show the code
pure subroutine move_value(from, to)
type(value_t), intent(inout) :: from !! the value
type(value_t), intent(inout) :: to !! where it goes
to%kind = from%kind
to%number = from%number
if (allocated(to%text)) deallocate (to%text)
if (allocated(to%items)) deallocate (to%items)
if (allocated(from%text)) call move_alloc(from%text, to%text)
if (allocated(from%items)) call move_alloc(from%items, to%items)
end subroutine move_value