From: EGarrulo <egarrulo@gmail.com>
Subject: Does `pragma inline` work when instantiating generic code?
Date: Sun, 26 Jul 2015 04:15:36 -0700 (PDT)
Date: 2015-07-26T04:15:36-07:00 [thread overview]
Message-ID: <12df0d47-d2d3-452b-8de8-27b50ae89c72@googlegroups.com> (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.
next reply other threads:[~2015-07-26 11:15 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-26 11:15 EGarrulo [this message]
2015-07-26 18:21 ` Does `pragma inline` work when instantiating generic code? Georg Bauhaus
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox