comp.lang.ada
 help / color / mirror / Atom feed
From: Samuel Tardieu <sam@ada.eu.org>
Subject: Re: Discrimant Record Types and GNAT
Date: 1999/01/12
Date: 1999-01-12T11:50:22+00:00	[thread overview]
Message-ID: <87ogo490cf.fsf@zaphod.enst.fr> (raw)
In-Reply-To: 369A84AB.CD5B5A4D@nordnet.fr

>>>>> "Arnaud" == abailly  <abailly@nordnet.fr> writes:

Arnaud> I've been taught by my Ada teacher that this kind of object
Arnaud> could be declared as tab1 : Rec; and then used with tab1 :=
Arnaud> <any_rec> effectively creating an unconstrained array.

Sure, the maximum size will be reserved, that's why you will be able
to store any record in it. However, here the maximum size is the one
of an array with up to Positive'Last components.

Arnaud> Anyone got an answer to this problem ?

There are several solutions of course, two of them being
straightforward:

  - don't set a default value and use pointers
  - use a smaller subtype than positive

  Sam
-- 
Samuel Tardieu -- sam@ada.eu.org




  reply	other threads:[~1999-01-12  0:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-01-11  0:00 Discrimant Record Types and GNAT abailly
1999-01-12  0:00 ` Samuel Tardieu [this message]
1999-01-12  0:00 ` Matthew Heaney
replies disabled

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