From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.5-pre1 Path: eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: "Jeffrey R. Carter" Newsgroups: comp.lang.ada Subject: Re: Unchecked_Deallocation with tagged types Date: Sun, 18 Apr 2021 11:07:35 +0200 Organization: Also freenews.netfront.net; news.tornevall.net; news.eternal-september.org Message-ID: References: <607b56f8$0$3721$426a34cc@news.free.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Sun, 18 Apr 2021 09:07:37 -0000 (UTC) Injection-Info: reader02.eternal-september.org; posting-host="88088efd9dc72ce5e90e5f993c480531"; logging-data="7584"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19Svr/+W4UQWO1Ny5W0YwLQuZAzwkXAAG0=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 Cancel-Lock: sha1:u0QXxYbHqfk1ggP35+YIxnpcetM= In-Reply-To: Content-Language: en-US Xref: reader02.eternal-september.org comp.lang.ada:61814 List-Id: On 4/18/21 12:36 AM, Rod Kay wrote: > On 18/4/21 8:29 am, Rod Kay wrote: >> I believe it is ... >> >>    procedure free is new Ada.unchecked_Deallocation (t_Element, >> t_Element_Record'Class); > > Ugh ... I mean ... > >    procedure free is new Ada.unchecked_Deallocation (t_Element_Record'Class, > t_Element); No, you mean ... new Ada.Unchecked_Deallocation (Object => Name_Repeating_2_Things_From_The_Code'Class, Name => Name_Repeating_1_Thing_From_The_Code); which ensures that you don't make a mistake when you write it, and understand what is what when you read it (although Pointer would be better than Name). -- Jeff Carter "Run away! Run away!" Monty Python and the Holy Grail 58