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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,c50f57c0c29b391b X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!newsfeed2.dallas1.level3.net!news.level3.com!newsfeed-00.mathworks.com!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: memory management Date: 26 May 2005 08:10:40 -0400 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <1131064.rs72P29t4t@yahoo.com> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls4.std.com 1117109440 9514 192.74.137.71 (26 May 2005 12:10:40 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Thu, 26 May 2005 12:10:40 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Xref: g2news1.google.com comp.lang.ada:11164 Date: 2005-05-26T08:10:40-04:00 List-Id: alex goldman writes: > As I understood from reading the Ada tutorial for C/C++ programmers, > "access" is essentially like C++ smart pointer, No, Ada access types are just pointers -- no "smarts". To make something like smart pointers, you can use controlled types. >... except that you don't need > to do anything to dereference it. Dereference of access types uses the syntax ".all", but it's allowed to be implicit in most contexts (for example, X.Y means X.all.Y, if X is an access value (pointer)). > How will the following work: > > Record A contains "access" to record B; > record B contains "access" to record A. > > If I create an instance of one of them with "new", will it be destroyed when > "access" to it goes out of scope? No. - Bob