comp.lang.ada
 help / color / mirror / Atom feed
From: Brian Rogoff <bpr@shell5.ba.best.com>
Subject: Re: C++ STL Components and Ada
Date: Tue, 17 Jul 2001 04:26:02 GMT
Date: 2001-07-17T04:26:02+00:00	[thread overview]
Message-ID: <Pine.BSF.4.21.0107162104100.23396-100000@shell5.ba.best.com> (raw)
In-Reply-To: <3B5237EC.D54299A7@worldnet.att.net>

On Mon, 16 Jul 2001, James Rogers wrote:
> Occasionally I read questions from Ada newbies about the presence of
> Ada equivalents to the C++ STL. 
> 
> After many years of reading about and hearing from C++ programmers that
> the STL is the best thing since the invention of fire, I decided to
> look into exactly what the STL is. Ok, I took a little longer than 
> others :-).

The important thing you seem to be missing in your post is the presence of 
an ancillary type called iterators which are defined over the containers
and abstract the traversal so that algorithms are decoupled from
containers. You can do this in Ada too, but it's notationally a bit nicer
in C++ since the iterators over the commonest sequences map directly to
pointers.

I wouldn't say they're the best thing since the invention of fire, but C++
templates allow all sorts of interesting things, almost like macros, but
linked with the type system. They provide a crude form of parametric
polymorphism which doesn't have the overhead associated with typical
implementations of polymorphic languages. I can easily imagine an Ada-like
language which steals some nice aspects of C++ templates. 

-- Brian





  reply	other threads:[~2001-07-17  4:26 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-07-16  0:37 C++ STL Components and Ada James Rogers
2001-07-17  4:26 ` Brian Rogoff [this message]
2001-07-17 14:48   ` James Rogers
2001-07-17 19:47     ` Jon Orris
2001-07-18  3:09       ` James Rogers
2001-07-18 15:48         ` Matthias Benkmann
2001-07-18 18:00         ` Jon Orris
2001-07-19 20:48     ` Ray Blaak
2001-07-20  0:40       ` Brian Rogoff
replies disabled

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