comp.lang.ada
 help / color / mirror / Atom feed
From: "amado.alves" <amado.alves@netcabo.pt>
To: <comp.lang.ada@ada-france.org>
Subject: RE: Problem whith objects, access and abstract tagged private types
Date: Thu, 8 Jan 2004 14:51:29 -0000
Date: 2004-01-08T14:51:29+00:00	[thread overview]
Message-ID: <mailman.4.1073573511.279.comp.lang.ada@ada-france.org> (raw)

<<
...
      type Item_Elmt is access all Item_Type'Class;
...
   function To_Item_Elmt (F : in Item_Type'Class) return Item_Elmt is
      My_Tag : constant Ada.Tags.Tag := F'Tag;
   begin
      return new My_Tag' (F);
   end To_Item_Elmt;
>>

According to your own definition of Item_Elmt and To_Item_Elmt you must return an access value, not a Tag. Maybe you want to return an access to F. As it stands, you cannot, because F might be a value. If the actual parameter passed is always a variable then use mode in out for F. The return something along the lines of F'Access.



             reply	other threads:[~2004-01-08 14:51 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-08 14:51 amado.alves [this message]
  -- strict thread matches above, loose matches on Subject: below --
2004-01-08 13:58 Problem whith objects, access and abstract tagged private types Bruno
2004-01-08 14:56 ` Georg Bauhaus
2004-01-08 15:22 ` Dmitry A. Kazakov
2004-01-08 18:31 ` Jeffrey Carter
replies disabled

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