comp.lang.ada
 help / color / mirror / Atom feed
* how to get aliased string pointer
@ 2001-07-12 11:55 Maxim Reznik
  2001-07-12 17:19 ` Jeffrey Carter
  0 siblings, 1 reply; 3+ messages in thread
From: Maxim Reznik @ 2001-07-12 11:55 UTC (permalink / raw)


Hello CLA,

Compiling following programm in GNAT3.13p I get error

aaa.adb:16:10: object subtype must statically match designated subtype

procedure aaa is

   type Shared_String (Length : Natural) is record
       Count : Natural := 1;
       Space : aliased String (1 .. Length);
       pragma Atomic (Count);
   end record;


   type String_Access is access all String;

   p: String_Access;
   str: Shared_String(10);

begin
   p:=str.Space'Access;
end;

Actually I would like to have a function that returns String_Access
pointed to string located in an Shared_String object.

   function Get_String (U  : Shared_String_Access) return String_Access is
   begin
      return U.Space'Access;
   end;

Is there any way to make such function?

As far as I understand I unable to convert constrained
subtype to unconstrained.


--
Maxim Reznik






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

end of thread, other threads:[~2001-07-13  7:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-07-12 11:55 how to get aliased string pointer Maxim Reznik
2001-07-12 17:19 ` Jeffrey Carter
2001-07-13  7:19   ` Maxim Reznik

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