comp.lang.ada
 help / color / mirror / Atom feed
* C++ templates vs. Ada generics?
@ 1996-06-20  0:00 Dale Stanbrough
  1996-06-20  0:00 ` Ray Blaak
  0 siblings, 1 reply; 3+ messages in thread
From: Dale Stanbrough @ 1996-06-20  0:00 UTC (permalink / raw)



A few times posts in this group have indicated that C++ templates
allow you to do things that can't be done by Ada generics, but
this comes at the cost of link time checking (and possible
rejection by the linker) for what are in essence generic contract
model violations.

Is this correct, and does anyone have any examples of what can be
achieved in C++ templates, but not Ada generics?


Dale




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: C++ templates vs. Ada generics?
  1996-06-20  0:00 C++ templates vs. Ada generics? Dale Stanbrough
@ 1996-06-20  0:00 ` Ray Blaak
  1996-06-20  0:00   ` David Weller
  0 siblings, 1 reply; 3+ messages in thread
From: Ray Blaak @ 1996-06-20  0:00 UTC (permalink / raw)



Dale Stanbrough <dale@goanna.cs.rmit.EDU.AU> writes:

>[...] does anyone have any examples of what can be
>achieved in C++ templates, but not Ada generics?

On the fly instantiations (i.e. as a parameter to a function). Technically this
does not provide any extra ability, but it can be wonderfully succinct,
especially for one-time uses of the instantiation.

Cheers,
Ray Blaak




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: C++ templates vs. Ada generics?
  1996-06-20  0:00 ` Ray Blaak
@ 1996-06-20  0:00   ` David Weller
  0 siblings, 0 replies; 3+ messages in thread
From: David Weller @ 1996-06-20  0:00 UTC (permalink / raw)



In article <4qbtid$bsq@map.mda.ca>, Ray Blaak <blaak@mda.ca> wrote:
>Dale Stanbrough <dale@goanna.cs.rmit.EDU.AU> writes:
>>[...] does anyone have any examples of what can be
>>achieved in C++ templates, but not Ada generics?
>On the fly instantiations (i.e. as a parameter to a function). Technically this
>does not provide any extra ability, but it can be wonderfully succinct,
>especially for one-time uses of the instantiation.
>


Hmm, I don't understand how you _can't_ do this.  Admittedly, I'd have
to enclose it in a block, but that's trivial compared to the "Butt
Ugly" syntax of C++ templates (you may quote me :-)

-- 
    Visit the Ada 95 Booch Components Homepage: www.ocsystems.com/booch
           This is not your father's Ada -- lglwww.epfl.ch/Ada




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~1996-06-20  0:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-06-20  0:00 C++ templates vs. Ada generics? Dale Stanbrough
1996-06-20  0:00 ` Ray Blaak
1996-06-20  0:00   ` David Weller

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