comp.lang.ada
 help / color / mirror / Atom feed
From: gore@nucsrl.UUCP
Subject: Re: C++ as a way to use private types in C
Date: Fri, 20-Mar-87 22:45:26 EST	[thread overview]
Date: Fri Mar 20 22:45:26 1987
Message-ID: <3930005@nucsrl.UUCP> (raw)
In-Reply-To: 870318190934.056@Jpl-VLSI.ARPA

/ nucsrl:comp.lang.ada / WELTY@GE-CRD.ARPA (WELTY RICHARD P) /
> Objects in C++ (like objects in Flavors, CommonLoops, Smalltalk, etc.)
> may be dynamically allocated and freed -- Ada Generics are a somewhat
> weaker notion.

I'm not sure what you mean here.  My understanding is that you can instantiate
a generic within a scope, thus "dynamically allocating" it.  When you leave
the scope, it's gone, "dynamically freed"... sort of.  If the instance has
allocated heap space during its life, that space is not deallocated
automatically, but becomes the garbage collector's problem.

Unless there is no garbage collector;  then it becomes the programmer's
problem.  And the programmer doesn't have any elegant ways of solving it.

This is one of the features of C++ that I miss most in Ada:  constructors and
destructors.  It makes it unduly difficult to have abstract data types that
use dynamic storage -- both in assuring proper intialization, and in assuring
proper release.

Jacob Gore
Northwestern University, Computer Science Research Lab
{ihnp4,chinet}!nucsrl!gore

  parent reply	other threads:[~1987-03-21  3:45 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1987-03-19  3:09 C++ as a way to use private types in C larry
1987-03-19 16:40 ` bs
1987-03-19 16:57 ` Greg Lomow
1987-03-20 14:03   ` firth
1987-03-20 14:55 ` Leonard Vanek
1987-03-21  3:45 ` gore [this message]
  -- strict thread matches above, loose matches on Subject: below --
1987-03-19 16:20 WELTY RICHARD P
1987-03-19 19:03 WELTY RICHARD P
1987-03-20 14:35 ` bs
1987-03-31 17:08 WELTY
replies disabled

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