comp.lang.ada
 help / color / mirror / Atom feed
From: "Hyman Rosen" <hyman.rosen@gmail.com>
Subject: Re: generics in Ada 83
Date: 14 Sep 2005 08:23:01 -0700
Date: 2005-09-14T08:23:01-07:00	[thread overview]
Message-ID: <1126711381.425805.248380@o13g2000cwo.googlegroups.com> (raw)
In-Reply-To: ssa9gd.hhl.ln@hunter.axlog.fr

Jean-Pierre Rosen wrote:
> In Ada, there is no need to check legality on the expansion of the
> generic. Correct me if I'm wrong, but my understanding of templates is
> that the legality is rechecked for each instantiation.

Well, in Ada, instantiations check the parameters for validity
against whatever contract the generic specifies for them. In C++,
the contract is implied by the usage within the template, so yes,
the legality is rechecked that way. But remember that in C++
template instatntiation is done strictly at compile-time. As far
as the programmer is concerned, either an instantiation validly
meets the template's requirements for its parameters, or the code
fails to compile, and that is true for both languages (or at least
I think that's true for Ada).




  reply	other threads:[~2005-09-14 15:23 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-13 13:26 generics in Ada 83 REH
2005-09-13 13:30 ` Georg Bauhaus
2005-09-13 16:25   ` REH
2005-09-13 19:23     ` Georg Bauhaus
2005-09-13 13:50 ` Martin Dowie
2005-09-13 16:30   ` REH
2005-09-13 16:41     ` Martin Dowie
2005-09-13 18:43       ` REH
2005-09-13 19:37         ` Ludovic Brenta
2005-09-13 19:53           ` REH
2005-09-13 16:56 ` Jeffrey Carter
2005-09-13 18:53   ` REH
2005-09-13 22:16     ` Jeffrey Carter
2005-09-13 22:44       ` REH
2005-09-14  8:14   ` Jean-Pierre Rosen
2005-09-14 12:40     ` REH
2005-09-14 13:15     ` Hyman Rosen
2005-09-14 14:08       ` Jean-Pierre Rosen
2005-09-14 15:23         ` Hyman Rosen [this message]
2005-09-14 15:41           ` Robert A Duff
2005-09-19 17:58             ` REH
2005-09-20  4:58               ` Hyman Rosen
2005-09-20 12:36                 ` REH
2005-09-20  1:34             ` adaworks
2005-09-20  4:14               ` Jim Rogers
2005-09-21 22:58               ` Robert A Duff
2005-09-22 15:18                 ` adaworks
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox