comp.lang.ada
 help / color / mirror / Atom feed
From: gautier_niouzes@hotmail.com
Subject: Re: Choose between formal generic subprogram and subprogram access?
Date: Fri, 10 Nov 2017 00:59:33 -0800 (PST)
Date: 2017-11-10T00:59:33-08:00	[thread overview]
Message-ID: <734a413b-113b-4a30-98ef-9958e925ec75@googlegroups.com> (raw)
In-Reply-To: <otv0hu$83i$1@gioia.aioe.org>

> What are the good rules how to choose between formal generic subprogram vs 
> subprogram access argument/discriminant/field?

If the subprogram is always needed, I opt for the generic way. There are some advantages:
- no access - don't need to worry about a possible null or bad access
- performance: if the subprogram is at the centre of an algorithm, it can be inlined and further optimized within the part of the program where the call is occurring. Of course the absence of access check and indirect call may help a bit.
_________________________ 
Gautier's Ada programming 
http://sf.net/users/gdemont/

       reply	other threads:[~2017-11-10  8:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <otv0hu$83i$1@gioia.aioe.org>
2017-11-10  8:59 ` gautier_niouzes [this message]
2017-11-15 23:29 ` Choose between formal generic subprogram and subprogram access? Robert Eachus
2017-11-18  0:20 ` Shark8
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox