comp.lang.ada
 help / color / mirror / Atom feed
From: Georg Bauhaus <bauhaus@futureapps.invalid>
Subject: Re: Getting types from a generic container in Ada?
Date: Sun, 26 Jul 2015 19:36:05 +0200
Date: 2015-07-26T19:36:05+02:00	[thread overview]
Message-ID: <mp35n9$842$1@dont-email.me> (raw)
In-Reply-To: <dced2b52-e946-4795-9033-d37cc8c69561@googlegroups.com>

On 26.07.15 08:08, EGarrulo wrote:
> I would like to write a generic package that operates on standard containers. Such package would need access to various properties of a container, and I would like to get them from the container itself, instead of passing them as parameters for the generic package.  In other words, I would like to write something like:
>
>
> generic
>     type Container_Type is private;
> package My_Package is
>     procedure My_Function (Container : in out Container_Type;
>                            Element   :        Container_Type.Element_Type);
> end My_Package;
>
>
> Is this possible?  Thank you.

Reexport of generic parameters is not part of the design. It is
still possible to write some generic algorithms (using formal
packages, or signatures, or iterators, to the extent permitted
by design and non-recursive Ada templates.)

      reply	other threads:[~2015-07-26 17:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-26  6:08 Getting types from a generic container in Ada? EGarrulo
2015-07-26 17:36 ` Georg Bauhaus [this message]
replies disabled

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