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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,f30ef262af690ce0 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!b1g2000hsg.googlegroups.com!not-for-mail From: Maciej Sobczak Newsgroups: comp.lang.ada Subject: Re: numbers as 'generics' parameters Date: Mon, 19 May 2008 01:26:29 -0700 (PDT) Organization: http://groups.google.com Message-ID: <894a5a05-eee2-49a5-ac3f-be61f5751f49@b1g2000hsg.googlegroups.com> References: <482dd91a$1_3@news.bluewin.ch> <1g4p2jgvi3k8j.1j2xk6p9ws3a2.dlg@40tude.net> <9e99c5cd-fd94-4a38-89fd-681c0372b7ad@y38g2000hsy.googlegroups.com> NNTP-Posting-Host: 128.141.45.251 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: posting.google.com 1211185590 23038 127.0.0.1 (19 May 2008 08:26:30 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Mon, 19 May 2008 08:26:30 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: b1g2000hsg.googlegroups.com; posting-host=128.141.45.251; posting-account=bMuEOQoAAACUUr_ghL3RBIi5neBZ5w_S User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14,gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:223 Date: 2008-05-19T01:26:29-07:00 List-Id: On 19 Maj, 07:16, Ivan Levashew wrote: > > template > > void foo(const fixed_size_string & s1, > > const fixed_size_string & s2) > > AFAIK this will prevent N from being unknown at compile-time. Yes. > AFAIK C++, there could be > "foo <3> (const fixed_size_string<3> &, const fixed_size_string<3> &)", > "foo <4> (const fixed_size_string<4> &, const fixed_size_string<4> &)" > mangled names. Yes. > I'm not sure if C++ is able to convert dynamic template > parameters to subroutine parameters. There are no dynamic template parameters in C++. In other words, C++ templates and Ada generics solve overlapping, but not equivalent problems. > I think this particular case is a dead-end way of promoting either Ada > over C++ or C++ over Ada. I try not to do it. I can try, however, bring more light to the problem raised by OP. -- Maciej Sobczak * www.msobczak.com * www.inspirel.com