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=-0.4 required=3.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 Path: eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail From: "G.B." Newsgroups: comp.lang.ada Subject: Non-standard functions in GNAT's Ada.Containers packages? Date: Wed, 14 Sep 2022 14:36:07 +0200 Organization: A noiseless patient Spider Message-ID: Reply-To: nonlegitur@notmyhomepage.de MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Wed, 14 Sep 2022 12:36:08 -0000 (UTC) Injection-Info: reader01.eternal-september.org; posting-host="c65fd136a8d82416f5bf8c62f7da4e6b"; logging-data="3103090"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18yoN0cDKOhPX4OWrtWRinjrpP14KbEgXE=" User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.13.0 Cancel-Lock: sha1:2lmIwfQx7QUnYnXC/KPgPP8GSEg= Content-Language: en-US Xref: reader01.eternal-september.org comp.lang.ada:64328 List-Id: In Ada.Containers.{Kind}s of GCC 11.2, I find functions defined by the pattern: function Empty (Capacity : Count_Type := 1000) return {Kind}; I couldn't find these functions in the LRM's package specifications. Upon type derivation, then, these functions appear to require non-portable source text when using GNAT's standard Ada containers. For example, package Real_Vectors is new Ada.Containers.Vectors (...); type Fancy_Vectors is new Real_Vectors.Vector with private; 18. type Fancy_Vectors is new Real_Vectors.Vector with record | >>> type must be declared abstract or "Empty" overridden >>> "Empty" has been inherited at line 14 >>> "Empty" has been inherited from subprogram at a-convec.ads:125, instance at line 8 While composition would not incur this effect, etc. etc., still the resulting source text would need to override a "standard" function, but this function, Empty, might not exist at all when using other standard Ada compilers. Am I missing something?