comp.lang.ada
 help / color / mirror / Atom feed
From: "nicolas.b" <nicolas.blanpain@fr.thalesgroup.com>
Subject: pragma Inline in generic
Date: 20 Jul 2005 10:10:27 -0700
Date: 2005-07-20T10:10:27-07:00	[thread overview]
Message-ID: <1121879427.142113.314140@z14g2000cwz.googlegroups.com> (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.




             reply	other threads:[~2005-07-20 17:10 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-20 17:10 nicolas.b [this message]
2005-07-20 19:40 ` pragma Inline in generic Manuel G. R.
2005-07-20 20:45 ` Damien
2005-07-20 20:51   ` Damien
2005-07-27 13:52 ` Simon Wright
replies disabled

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