comp.lang.ada
 help / color / mirror / Atom feed
* Non-standard functions in GNAT's Ada.Containers packages?
@ 2022-09-14 12:36 G.B.
  2022-09-14 16:04 ` Egil H H
  0 siblings, 1 reply; 15+ messages in thread
From: G.B. @ 2022-09-14 12:36 UTC (permalink / raw)


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?

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2022-09-16 18:53 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-14 12:36 Non-standard functions in GNAT's Ada.Containers packages? G.B.
2022-09-14 16:04 ` Egil H H
2022-09-15  7:13   ` G.B.
2022-09-15 14:26     ` Marius Amado-Alves
2022-09-15 15:03       ` Niklas Holsti
2022-09-15 17:11         ` Marius Amado-Alves
2022-09-15 17:22           ` Dmitry A. Kazakov
2022-09-16 16:03             ` Marius Amado-Alves
2022-09-16 16:30               ` Marius Amado-Alves
2022-09-16 17:08                 ` Jere
2022-09-16 11:33           ` Björn Lundin
2022-09-16 15:00             ` Marius Amado-Alves
2022-09-16 15:42               ` Egil H H
2022-09-16 18:53               ` Björn Lundin
2022-09-16 15:47           ` Jere

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox