Re: limited types (Was: Records that could be arrays)
- From: "Matthew Heaney" <mheaney@xxxxxxx>
- Date: 28 Feb 2006 11:58:11 -0800
Dmitry A. Kazakov wrote:
On 28 Feb 2006 09:24:35 -0800, Matthew Heaney wrote:
I still don't see CS.
I wrote the declaration wrong; it should have been:
generic
type ET is private; --or: type ET (<>) is limited private;
type CT is private; --cursor type
with function E (C : CT) return ET is <>;
procedure Generic_Algorithm (C1, C2 : CT);
The cursor pair [C1, C2) describes a range of elements. It might be
the entire range of elements in the container, or just a subrange. The
algorithm doesn't care.
BTW, if I had CS, would need not to instantiate Generic_Algorithm once
more.
(I assume "CS" means "container of element type S, and S derives from
type T.")
As far as generic algorithms are concerned, it doesn't matter that type
S derives from type T. That's what "generic algorithm" means.
And yes, you have to instantiate the algorithm twice, since the cursor
types come from different instantiations of some generic container
package.
Of course, if you instantiate the indefinite container package on
generic actual type T'Class, then you'd only have to instantate generic
algorithm once (assuming generic formal type ET is declared
appropriately, as I show above in the comment).
.
- Follow-Ups:
- Re: limited types
- From: Simon Wright
- Re: limited types (Was: Records that could be arrays)
- From: Dmitry A. Kazakov
- Re: limited types
- References:
- limited types (Was: Records that could be arrays)
- From: Thierry Bernier
- Re: limited types (Was: Records that could be arrays)
- From: Randy Brukardt
- Re: limited types (Was: Records that could be arrays)
- From: Dmitry A. Kazakov
- Re: limited types (Was: Records that could be arrays)
- From: Matthew Heaney
- Re: limited types (Was: Records that could be arrays)
- From: Dmitry A. Kazakov
- Re: limited types (Was: Records that could be arrays)
- From: Matthew Heaney
- Re: limited types (Was: Records that could be arrays)
- From: Dmitry A. Kazakov
- Re: limited types (Was: Records that could be arrays)
- From: Matthew Heaney
- Re: limited types (Was: Records that could be arrays)
- From: Dmitry A. Kazakov
- Re: limited types (Was: Records that could be arrays)
- From: Georg Bauhaus
- Re: limited types (Was: Records that could be arrays)
- From: Dmitry A. Kazakov
- Re: limited types (Was: Records that could be arrays)
- From: Matthew Heaney
- Re: limited types (Was: Records that could be arrays)
- From: Dmitry A. Kazakov
- Re: limited types (Was: Records that could be arrays)
- From: Matthew Heaney
- Re: limited types (Was: Records that could be arrays)
- From: Dmitry A. Kazakov
- Re: limited types (Was: Records that could be arrays)
- From: Matthew Heaney
- Re: limited types (Was: Records that could be arrays)
- From: Dmitry A. Kazakov
- limited types (Was: Records that could be arrays)
- Prev by Date: Re: limited types (Was: Records that could be arrays)
- Next by Date: Re: accessing record element (question to the pros)
- Previous by thread: Re: limited types (Was: Records that could be arrays)
- Next by thread: Re: limited types (Was: Records that could be arrays)
- Index(es):
Relevant Pages
|
|