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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,2e589dbfe40b0d25 X-Google-Attributes: gid103376,public From: "Matthew Heaney" Subject: Re: Deallocating an object referenced via a classwide access type. Date: 2000/01/11 Message-ID: <387b764d_2@news1.prserv.net>#1/1 X-Deja-AN: 571277878 Content-transfer-encoding: 7bit References: <387aa062_4@news1.prserv.net> Content-Type: text/plain; charset="US-ASCII" X-Complaints-To: abuse@prserv.net X-Trace: 11 Jan 2000 18:28:29 GMT, 129.37.213.52 Organization: Global Network Services - Remote Access Mail & News Services Mime-version: 1.0 Newsgroups: comp.lang.ada Date: 2000-01-11T00:00:00+00:00 List-Id: In article <387aa062_4@news1.prserv.net> , "Matthew Heaney" wrote: > The basic idea is to declare a private operation (similar to what you > have in your example) that does the actual deallocation of the specific > type, and to call this operation by dispatching on the tag of the object > whose type is class-wide. Like this: > > package P is > > type T (<>) is abstract tagged limited null record; --0 > > type TA is access all T'Class; > for TA'Storage_Size use 0; -- avoid RTS baggage > > Oops! I forgot to mention that primitive ops for T take access parameters. Like this: procedure Op (O : access T); This is so, in order to avoid having to explicitly dereference the access object returned by constructors. -- Get the FAQs about evolution and creationism.