comp.lang.ada
 help / color / mirror / Atom feed
* Does `pragma inline` work when instantiating generic code?
@ 2015-07-26 11:15 EGarrulo
  2015-07-26 18:21 ` Georg Bauhaus
  0 siblings, 1 reply; 2+ messages in thread
From: EGarrulo @ 2015-07-26 11:15 UTC (permalink / raw)


Assuming this generic code (see the comment in the second file):

------ negate.ads ------

generic
   with function Predicate return Boolean;
function Negate return Boolean;

------ negate.adb ------

function Negate return Boolean is
begin
   return not Predicate; -- ##### Will the compiler inline this call? ######
end Negate;

------ test.adb ------

procedure Test is
   function My_Predicate return Boolean is begin
     return True;
   end My_Predicate;

   pragma inline(My_Predicate);

   function My_Not_Predicate is new Negate (My_Predicate);
   
   X : Boolean := My_Not_Predicate;
begin
   null;
end Test;

------------------------


Thank you.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-07-26 18:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-26 11:15 Does `pragma inline` work when instantiating generic code? EGarrulo
2015-07-26 18:21 ` Georg Bauhaus

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