From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=BAYES_00,INVALID_DATE autolearn=no autolearn_force=no version=3.4.4 Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watnot!watmath!clyde!rutgers!ames!ptsfa!ihnp4!chinet!nucsrl!gore From: gore@nucsrl.UUCP Newsgroups: comp.lang.ada Subject: Re: C++ as a way to use private types in C Message-ID: <3930005@nucsrl.UUCP> Date: Fri, 20-Mar-87 22:45:26 EST Article-I.D.: nucsrl.3930005 Posted: Fri Mar 20 22:45:26 1987 Date-Received: Sun, 22-Mar-87 21:14:22 EST References: <870318190934.056@Jpl-VLSI.ARPA> Organization: Northwestern U, Evanston IL, USA List-Id: / 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