与Python的super()类似的Fortran吗? [英] A Fortran analog to python's super()?

查看:44
本文介绍了与Python的super()类似的Fortran吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Fortran 2003/8中使用类,尤其是扩展类型时: 是否有python的super()函数的类似物可用于从扩展类型中调用的方法,该方法在扩展类型中已被覆盖?

When working with classes and in particular with extended types in Fortran 2003/8: is there any analog of python's super() function that can be used to call a method from the extending type which has been overridden in the extended type?

推荐答案

是的,如果父类型不是抽象的.

Yes, if the parent type is not abstract.

CALL object%ParentType%Binding(...)

否则,您始终可以只调用在父级中实现绑定的特定过程.

Otherwise you can always just call the specific procedure that implements the binding in the parent.

这篇关于与Python的super()类似的Fortran吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆