From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on ip-172-31-65-14.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-3.2 required=3.0 tests=BAYES_00,NICE_REPLY_A, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 Path: eternal-september.org!reader01.eternal-september.org!weretis.net!feeder8.news.weretis.net!3.eu.feeder.erje.net!feeder.erje.net!news-2.dfn.de!news.dfn.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Niklas Holsti Newsgroups: comp.lang.ada Subject: Re: Non-standard functions in GNAT's Ada.Containers packages? Date: Thu, 15 Sep 2022 18:03:16 +0300 Organization: Tidorum Ltd Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net ekBngJoysdzn9XM0tOufDg30EXZMP5P0BbQBSC99WIFh1cFlRy Cancel-Lock: sha1:hDjS7HV4SDHwD5aCE5/RGBM8ATI= User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:102.0) Gecko/20100101 Thunderbird/102.2.2 Content-Language: en-US In-Reply-To: Xref: reader01.eternal-september.org comp.lang.ada:64333 List-Id: On 2022-09-15 17:26, Marius Amado-Alves wrote: >> ... it seems best to have compilers for pre-202x at hand in case a >> program needs Ada 2005 containers or Ada 2012 containers. (G.B.) > > Sorry, but is all this new stuff not backward-compatible? (Except > maybe a teeny thing or two, easy to fix.) The incompatibility seems to arise only if one derives from the container types defined in the library. I don't think that is often needed in an application. > BTW, do the new containers fix map iteration? I'm always stupefied at > not being possible to iterate a map like you do a vector. Maps supported iteration already in Ada 2005, when the standard containers were added to Ada. There are functions First and Next, to give the first map element and to advance from an element to the next element, and also a procedure Iterate that traverses the whole map and performs some action on each element. In current Ada, one can also iterate over a map with the "generalized loop iteration" syntax, as in "for X of M loop ... end loop".