[1]BI Su-ping,ZHOU Zhen-hong,HE Xiao-hui.Fortran 90 Using Function Templates from C ++[J].Journal of Zhengzhou University (Engineering Science),2013,34(02):64-66.[doi:10.3969/ j. issn. 1671 -6833.2013.00.017]
Copy
Journal of Zhengzhou University (Engineering Science)[ISSN
1671-6833/CN
41-1339/T] Volume:
34
Number of periods:
2013 02
Page number:
64-66
Column:
Public date:
2013-03-28
- Title:
-
Fortran 90 Using Function Templates from C ++
- Author(s):
-
BI Su-ping1; ZHOU Zhen-hong2; HE Xiao-hui2
-
1. School of Civil Engineering ,Zhengzhou University , Zhengzhou 450001 , China; 2.School of Water Conservancy and Environ-ment,Zhengzhou University ,Zhengzhou 450001 ,China
-
- Keywords:
-
scientific and engineering computing; generic programming; function template ; generic interfaceblock ; mixed compiling
- CLC:
-
TP311
- DOI:
-
10.3969/ j. issn. 1671 -6833.2013.00.017
- Abstract:
-
The function template is a kind of generic programming,which possesses important practical signifi-cance in scientific and engineering computing.First , the implementing mechanism of C ++ function template isexplored , and the relationship between function templates and overloaded functions is disclosed. C ++ overloa-ded functions are modeled with the generic interface block plus external procedures of Fortran 90. Then , awrapper of C ++ function templates is appended in order to instantiate function templates,convert functiontemplate instances into “ overloaded”procedures , and make use of C ++ function templates in Fortran 90. Theabove-mentioned methods are particularly demonstrated with a demo. The research will also be helpful in ap-plying C ++ function templates in other languages.