From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,c6b9934af04bce01 X-Google-Attributes: gid103376,public From: Gautier Subject: Re: A question to the "access-type lifetime rule" Date: 2000/04/03 Message-ID: <38E8EA8A.CD3C8134@maths.unine.ch>#1/1 X-Deja-AN: 606185223 Content-Transfer-Encoding: 7bit References: <38E89AB9.7D33E88C@hamilton.physik.uni-konstanz.de> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii X-Trace: 3 Apr 2000 21:01:30 +0100, mac13-32.unine.ch Organization: Maths - Uni =?iso-8859-1?Q?Neuch=E2tel?= MIME-Version: 1.0 Newsgroups: comp.lang.ada Date: 2000-04-03T00:00:00+00:00 List-Id: Bernd Rinn: As other replies point out, the generic approach is the best. generic with function Integrand_Type( X : Long_Float ) return Long_Float; function Integrate(Lower_Bound, Upper_Bound: Long_Float) return Long_Float; Not only for avoiding any bad surprise with pointers, robustness or Ada-style, but also for efficiency reasons: according to the function you plug in as generic parameter, the contents of that function will be inlined into the "Integrate" function, plus optimised by the compiler. Reversely, each reference to a pointer to a function will be at least an indirection slower than the generic version. HTH ______________________________________________________ Gautier -- http://members.xoom.com/gdemont/gsoft.htm