Re: memory management
- From: Robert A Duff <bobduff@xxxxxxxxxxxxxxxxxxxx>
- Date: 26 May 2005 08:10:40 -0400
alex goldman <hello@xxxxxxxx> 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
.
- Follow-Ups:
- Re: memory management
- From: Martin Krischik
- Re: memory management
- References:
- memory management
- From: alex goldman
- memory management
- Prev by Date: Re: Using GNAT.Sockets with Streams and Byte Swapping
- Next by Date: Re: memory management
- Previous by thread: Re: memory management
- Next by thread: Re: memory management
- Index(es):