I am in the midst of write a small Fortran library and found a need to define a template for a set of methods and instantiate them using it for different intrinsic types. With GNU fortran, I did something along the line of the following.
#define TEMPLATE(type_name,size) \ TYPE(type_name) FUNCTION PROCNAME(init,type_name) result(o) ;\ ... ;\ END FUNCTION PROCNAME(init,type_name) ;\ SUBROUTINE PROCNAME(push,type_name)(this) ; \ CLASS(type_name), INTENT(INOUT) :: this ; \ ... ; \ END SUBROUTINE PROCNAME(push,type_name)
This worked O.K. with GNU Fortran 4.8.0. But ifort 14.0 complains with
error #5141: END statement must be only statement on line
Is there a work-around to have multiple subroutine definitions in a single line?