(j3.2006) Chaining type-bound procedure references
Bill Long
longb
Fri May 2 15:15:53 EDT 2014
On May 2, 2014, at 1:51 PM, Van Snyder <Van.Snyder at jpl.nasa.gov> wrote:
> On Fri, 2014-05-02 at 01:00 -0400, Rafik Zurob wrote:
>> C++ can get away with x.foo().bar() because inlining is part of the
>> language and the definitions of inline member functions appear in the
>> same translation unit as the call. That's not the case in Fortran.
>
> Essentially the same mechanism that C++ uses to signal inlining, viz.,
> defining the function within the class definition, was proposed for
> Fortran in about 1986.
Just because Fortran does not have an INLINE keyword does not mean you get no inlining. Statement functions, internal procedures, procedures defined in a module that is USE'd, and procedures defined in the same source file are all pretty common candidates for automatic inlining. There are usually compiler flags available to widen the scope. In some cases all the way up to ?whole program analysis? where the inlining and optimization is deferred to the link step. Then everything except the main program is a candidate, although hopefully the compiler makes reasonable choices, usually based on the inline candidate?s size and complexity.
Cheers,
Bill
>
>
> _______________________________________________
> J3 mailing list
> J3 at mailman.j3-fortran.org
> http://mailman.j3-fortran.org/mailman/listinfo/j3
Bill Long longb at cray.com
Fortran Technical Suport & voice: 651-605-9024
Bioinformatics Software Development fax: 651-605-9142
Cray Inc./ Cray Plaza, Suite 210/ 380 Jackson St./ St. Paul, MN 55101
More information about the J3
mailing list