comp.lang.ada
 help / color / mirror / Atom feed
From: Laurent <daemon2@internet.lu>
Subject: Re: Problem with generic package
Date: Wed, 16 Apr 2014 13:37:39 -0700 (PDT)
Date: 2014-04-16T13:37:39-07:00	[thread overview]
Message-ID: <bcdf03f3-7768-456c-b1cb-536382b32466@googlegroups.com> (raw)
In-Reply-To: <534e1d23$0$6710$9b4e6d93@newsspool3.arcor-online.net>


> Example:

> generic
>     type T is private;
> package Stack is
>      procedure push (Item : T);
>      generic
>         with function Compare (X, Y : T) return Boolean;
>      procedure Sort; 
> end Stack;

Yes thanks that is clear and got my test to work.

@Adam: Sry there are moments where I am blocking on a problem
and I don't see anything around.

If I have a big generic package but I need only one function from it
but for different types. I have to instantiate the package once for every type.
Which means that there will be a lot of memory allocated for
unused things? Or is the compiler smart enough to cut the unused
parts off?

Thanks

Laurent


  reply	other threads:[~2014-04-16 20:37 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-15 18:26 Problem with generic package Laurent
2014-04-15 19:36 ` Adam Beneschan
2014-04-15 19:44 ` Adam Beneschan
2014-04-15 20:12   ` Laurent
2014-04-15 20:37     ` Adam Beneschan
2014-04-15 20:43     ` Eryndlia Mavourneen
2014-04-15 20:47       ` Eryndlia Mavourneen
2014-04-15 21:28     ` Georg Bauhaus
2014-04-15 20:41 ` Simon Wright
2014-04-15 21:12   ` Laurent
2014-04-15 21:27     ` Adam Beneschan
2014-04-15 21:58       ` Laurent
2014-04-15 22:03         ` Adam Beneschan
2014-04-16  6:03         ` Georg Bauhaus
2014-04-16 20:37           ` Laurent [this message]
2014-04-16 21:13             ` Mike H
2014-04-16 22:31               ` Randy Brukardt
2014-04-16 23:06               ` Jeffrey Carter
2014-04-15 22:14     ` Simon Wright
2014-04-16 18:49       ` Laurent
replies disabled

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