Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Ada > Re: limited typ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 23 of 26 Topic 4222 of 5857
Post > Topic >>

Re: limited types (Was: Records that could be arrays)

by "Matthew Heaney" <mheaney@[EMAIL PROTECTED] > Feb 28, 2006 at 11:58 AM

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).
 




 26 Posts in Topic:
limited types (Was: Records that could be arrays)
Thierry Bernier <email  2006-02-24 16:51:03 
Re: limited types (Was: Records that could be arrays)
"Randy Brukardt"  2006-02-24 15:57:46 
Re: limited types (Was: Records that could be arrays)
Matthew Heaney <matthe  2006-02-25 02:21:13 
Re: limited types (Was: Records that could be arrays)
Matthew Heaney <matthe  2006-02-25 03:38:59 
Re: limited types (Was: Records that could be arrays)
"Dmitry A. Kazakov&q  2006-02-25 12:06:20 
Re: limited types (Was: Records that could be arrays)
Matthew Heaney <matthe  2006-02-25 15:05:02 
Re: limited types (Was: Records that could be arrays)
"Randy Brukardt"  2006-02-25 19:01:06 
Re: limited types (Was: Records that could be arrays)
"Dmitry A. Kazakov&q  2006-02-26 10:00:07 
Re: limited types (Was: Records that could be arrays)
Matthew Heaney <matthe  2006-02-26 18:20:39 
Re: limited types (Was: Records that could be arrays)
"Dmitry A. Kazakov&q  2006-02-26 21:52:32 
Re: limited types (Was: Records that could be arrays)
Matthew Heaney <matthe  2006-02-26 22:07:00 
Re: limited types (Was: Records that could be arrays)
"Dmitry A. Kazakov&q  2006-02-27 10:11:28 
Re: limited types (Was: Records that could be arrays)
Georg Bauhaus <bauhaus  2006-02-27 15:34:58 
Re: limited types (Was: Records that could be arrays)
"Dmitry A. Kazakov&q  2006-02-27 17:05:47 
Re: limited types (Was: Records that could be arrays)
"Matthew Heaney"  2006-02-27 08:52:23 
Re: limited types (Was: Records that could be arrays)
"Dmitry A. Kazakov&q  2006-02-27 21:21:08 
Re: limited types (Was: Records that could be arrays)
Georg Bauhaus <bauhaus  2006-02-27 22:40:18 
Re: limited types (Was: Records that could be arrays)
"Dmitry A. Kazakov&q  2006-02-28 10:38:31 
Re: limited types (Was: Records that could be arrays)
"Matthew Heaney"  2006-02-27 15:00:29 
Re: limited types (Was: Records that could be arrays)
"Dmitry A. Kazakov&q  2006-02-28 10:39:20 
Re: limited types (Was: Records that could be arrays)
"Matthew Heaney"  2006-02-28 09:24:35 
Re: limited types (Was: Records that could be arrays)
"Dmitry A. Kazakov&q  2006-02-28 20:06:50 
Re: limited types (Was: Records that could be arrays)
"Matthew Heaney"  2006-02-28 11:58:11 
Re: limited types (Was: Records that could be arrays)
"Dmitry A. Kazakov&q  2006-02-28 22:03:37 
Re: limited types
Simon Wright <simon@[E  2006-02-28 21:51:52 
Re: limited types
Matthew Heaney <matthe  2006-03-01 01:59:16 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Wed Aug 20 4:22:37 CDT 2008.