complex4_guard Function

private function complex4_guard(this, lhs) result(ret)

Arguments

Type IntentOptional AttributesName
class(complex4_container), intent(in) :: this
class(*), intent(inout) :: lhs

Return Value logical

Description

Transfers the container's contents to the variable on the left hand side of the equals sign if it is of the correct type.


Source Code

  logical function complex4_guard(this, lhs) result(ret)
    !! Author: Chris MacMackin
    !! Date: December 2015
    !!
    !! Transfers the container's contents to the variable on the left
    !! hand side of the equals sign if it is of the correct type.
    class(complex4_container), intent(in) ::  this
    class(*), intent(inout) ::  lhs
    select type(lhs)
      type is(complex(r4))
        lhs = transfer(this%contents(), lhs)
        ret = .true.
      class default
        ret = .false.
    end select
  end function complex4_guard