Ada-Rapporteur-Group / User-Community-Input

Ada User Community Input Working Group - Github Mirror Prototype

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Default value for Count in Ada.Containers.Vectors.Append.

Blady-Com opened this issue · comments

Current definitions in Ada.Containers.Vectors:

procedure Prepend  (Container : in out Vector; New_Item  : Element_Type; Count : Count_Type := 1);
procedure Append   (Container : in out Vector; New_Item  : Element_Type; Count : Count_Type);

Proposal definition:
Add a default value for Count in Append as for Prepend:
procedure Append (Container : in out Vector; New_Item : Element_Type; Count : Count_Type := 1);

Thanks for your explanation, it's make sens :-).

Note GNAT FSF 13.2 stil defines in aconvec.ads:

   procedure Append
     (Container : in out Vector;
      New_Item  : Vector) renames Append_Vector;
   --  Retained for now for compatibility; AI12-0400 will remove this.

This was a very tricky fix, because it created some incompatibilities. I think this was a first step. It is probably time now to finish the job and implement what is defined by the Ada 2022 standard.

This question was adequately answered, so I am closing this Issue.