再帰型を宣言しました:
type treeNode
private
class(treeNode), pointer :: left => null()
class(treeNode), pointer :: right => null()
contains
procedure, non_overridable :: IsNull ! Returns true if link is null
end type treeNode
「IsNull」関数を実装したいと思います。
! ----
pure function IsNull( theNode )
logical(LGT) :: IsNull
class(treeNode), pointer, intent(IN) :: theNode
IsNull = .not. associated( theNode )
end function IsNull
Gfortran はポインター属性について不平を言います:
ポインター属性を削除して、ターゲット属性に置き換えた (または何も置き換えなかった) 場合、関連する構成を使用できません。また、gfortran では null() と同等かどうかをテストすることもできません。
質問: 実際の引数が null であることをテストするにはどうすればよいですか?