Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

implemented move_alloc for string_type #467

Merged
merged 7 commits into from
Aug 26, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
added move for both arguments as character allocatables
aman-godara committed Jul 28, 2021
commit 73ec8c57d8b168e385f2da0b1a1960235a8c5aaf
11 changes: 11 additions & 0 deletions src/stdlib_string_type.fypp
Original file line number Diff line number Diff line change
@@ -214,6 +214,7 @@ module stdlib_string_type
module procedure :: move_string_string
module procedure :: move_string_char
module procedure :: move_char_string
module procedure :: move_char_char
end interface move

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

end subroutine move_char_string

!> Moves the allocated character scalar from 'from' to 'to'
!> No output
subroutine move_char_char(from, to)
character(len=:), intent(inout), allocatable :: from
character(len=:), intent(inout), allocatable :: to

call move_alloc(from, to)

end subroutine move_char_char

!> Compare two character sequences for being greater.
!> In this version both character sequences are by a string.
elemental function gt_string_string(lhs, rhs) result(is_gt)