Skip to content

Commit 73ec8c5

Browse files
committed
added move for both arguments as character allocatables
1 parent e0c8b8f commit 73ec8c5

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/stdlib_string_type.fypp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,7 @@ module stdlib_string_type
214214
module procedure :: move_string_string
215215
module procedure :: move_string_char
216216
module procedure :: move_char_string
217+
module procedure :: move_char_char
217218
end interface move
218219

219220
!> Lexically compare the order of two character sequences being greater,
@@ -761,6 +762,16 @@ contains
761762

762763
end subroutine move_char_string
763764

765+
!> Moves the allocated character scalar from 'from' to 'to'
766+
!> No output
767+
subroutine move_char_char(from, to)
768+
character(len=:), intent(inout), allocatable :: from
769+
character(len=:), intent(inout), allocatable :: to
770+
771+
call move_alloc(from, to)
772+
773+
end subroutine move_char_char
774+
764775
!> Compare two character sequences for being greater.
765776
!> In this version both character sequences are by a string.
766777
elemental function gt_string_string(lhs, rhs) result(is_gt)

0 commit comments

Comments
 (0)