comp.lang.ada
 help / color / mirror / Atom feed
* pragma Inline in generic
@ 2005-07-20 17:10 nicolas.b
  2005-07-20 19:40 ` Manuel G. R.
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: nicolas.b @ 2005-07-20 17:10 UTC (permalink / raw)


This is my program (a short example) :

-- A generic package
generic
   type T_Real is digits <>;
   Default_Real : T_Real;
package Toto is
   type T_Toto is private;
   function Length (Toto : in T_Toto) return T_Real;
   pragma Inline (Length);
private
   type T_Toto is record
      Length : T_Real := Default_Real;
   end record;
end Toto;
-- the implementation :
package body Toto is
   function Length (Toto : in T_Toto) return T_Real is
   begin
      return Toto.Length;
   end Length;
end Toto;

-- The instanciation :
with Toto;
pragma Elaborate_All (Toto);
package Test is
   package Instance_Toto is new Toto (
      T_Real => Float,
      Default_Real => 0.0);
procedure Test;
end Test;
-- the implementation of this instanciation :
package body Test is
   procedure Test is
      T : Instance_Toto.T_Toto;
      L : float;
   begin
      L := Instance_Toto.Length (T);
   end Test;
end Test;

I use gnat 5.02a1 : function "Length" seems not be Inline in generate
code. Why? Thank you for your answer.




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

end of thread, other threads:[~2005-07-27 13:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-07-20 17:10 pragma Inline in generic nicolas.b
2005-07-20 19:40 ` Manuel G. R.
2005-07-20 20:45 ` Damien
2005-07-20 20:51   ` Damien
2005-07-27 13:52 ` Simon Wright

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