在Fortran中实现一组队列的简单方法? [英] Simple way to implement a group of queues in Fortran?
问题描述
另一种看待这个问题的方式是我找到的方式:在Fortran中定义我自己的结构之后,我不得不用C ++编写程序,然后我看到使用模板是多么容易......现在,我想用我的母语也是一样......
似乎知识不是总是很舒服
非常感谢! 解决方案
模板,有 Pyf95 ++ 。它为Fortran提供了使用预处理器的模板和STL。 (有关此处)
使用 transfer()
的泛型链表可以在 FLIBS 。
(否则,如果您使用流畅的编译器,您可以使用Richard Lozes所建议的无限制多态性。)
Suppose that I need to implement at least 5 queues in one procedure, each of it from a different defined type. How can achive this in a simple and short way?.
Another way to see the question is the way that came to me: after a lot of time of defining my own structures in fortran, I had to make a program in C++, and then I saw how easy is the use of templates... now, I want the same in my mother tongue....
seems that the knowledge is not always confortable
Thanks a lot!
If you really want templates, there is Pyf95++. It brings templating and an STL for Fortran using a preprocessor. (for download here)
A generic linked-list that uses transfer()
can be found in FLIBS.
(Otherwise with a bleeding edge compiler you can use unlimited polymorphism as suggested by Richard Lozes.)
这篇关于在Fortran中实现一组队列的简单方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!