From: Maciej Sobczak <see.my.homepage@gmail.com>
Subject: Re: numbers as 'generics' parameters
Date: Mon, 19 May 2008 01:26:29 -0700 (PDT)
Date: 2008-05-19T01:26:29-07:00 [thread overview]
Message-ID: <894a5a05-eee2-49a5-ac3f-be61f5751f49@b1g2000hsg.googlegroups.com> (raw)
In-Reply-To: g0r1g1$kpv$1@registered.motzarella.org
On 19 Maj, 07:16, Ivan Levashew <octag...@bluebottle.com> wrote:
> > template <size_t N>
> > void foo(const fixed_size_string<N> & s1,
> > const fixed_size_string<N> & 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
next prev parent reply other threads:[~2008-05-19 8:26 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-16 17:26 numbers as 'generics' parameters jhc0033
2008-05-16 17:55 ` Adam Beneschan
2008-05-16 19:12 ` John B. Matthews
2008-05-16 18:34 ` jimmaureenrogers
2008-05-16 18:57 ` Gautier
2008-05-16 20:52 ` Maciej Sobczak
2008-05-16 23:09 ` Peter C. Chapin
2008-05-17 7:47 ` Dmitry A. Kazakov
2008-05-17 16:29 ` Maciej Sobczak
2008-05-17 17:34 ` Dmitry A. Kazakov
2008-05-18 13:58 ` Maciej Sobczak
2008-05-18 14:52 ` Dmitry A. Kazakov
2008-05-18 20:37 ` Maciej Sobczak
2008-05-19 9:02 ` Dmitry A. Kazakov
2008-05-19 5:16 ` Ivan Levashew
2008-05-19 8:26 ` Maciej Sobczak [this message]
2008-05-16 20:22 ` Jeffrey R. Carter
2008-05-21 15:32 ` Robert A Duff
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox