From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,cea03ed275aa3d28 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!postnews.google.com!p79g2000cwp.googlegroups.com!not-for-mail From: "Martin Krischik" Newsgroups: comp.lang.ada Subject: Re: Question about generics. Date: 3 Jul 2006 02:46:36 -0700 Organization: http://groups.google.com Message-ID: <1151919996.860911.91880@p79g2000cwp.googlegroups.com> References: NNTP-Posting-Host: 194.41.216.139 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: posting.google.com 1151920002 2764 127.0.0.1 (3 Jul 2006 09:46:42 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Mon, 3 Jul 2006 09:46:42 +0000 (UTC) In-Reply-To: User-Agent: G2/0.2 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.0; de; rv:1.8.0.4) Gecko/20060508 Firefox/1.5.0.4,gzip(gfe),gzip(gfe) X-HTTP-Via: 1.0 fproxy.post.ch:3128 (squid/2.5.STABLE10) Complaints-To: groups-abuse@google.com Injection-Info: p79g2000cwp.googlegroups.com; posting-host=194.41.216.139; posting-account=2-0LkQwAAAAQMhPSoYwlMiUmi-6lYh44 Xref: g2news2.google.com comp.lang.ada:5425 Date: 2006-07-03T02:46:36-07:00 List-Id: Peter C. Chapin wrote: > template< int size > > class Xyzzy { > char array[size]; // size is a compile time constant. > }; in Ada you could use: generic type Array_Type is array (Integer range <>) of Character. package Xyzzy is Size : constant Positive := Array_Type'Lenght; end Xyzzy; Martin