comp.lang.ada
 help / color / mirror / Atom feed
From: "Maxim Reznik" <max1@mbank.com.ua>
Subject: how to get aliased string pointer
Date: Thu, 12 Jul 2001 14:55:10 +0300
Date: 2001-07-12T11:56:56+00:00	[thread overview]
Message-ID: <9ik3a4$1pd8$1@news.kiev.sovam.com> (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






             reply	other threads:[~2001-07-12 11:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-07-12 11:55 Maxim Reznik [this message]
2001-07-12 17:19 ` how to get aliased string pointer Jeffrey Carter
2001-07-13  7:19   ` Maxim Reznik
replies disabled

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