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.5 required=3.0 tests=BAYES_05,FORGED_GMAIL_RCVD, FREEMAIL_FROM,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Received: by 2002:adf:fd52:0:b0:2ce:a631:4a0 with SMTP id h18-20020adffd52000000b002cea63104a0mr346335wrs.14.1678874735229; Wed, 15 Mar 2023 03:05:35 -0700 (PDT) X-Received: by 2002:a9d:4c09:0:b0:699:7d71:d2dc with SMTP id l9-20020a9d4c09000000b006997d71d2dcmr854205otf.6.1678874734622; Wed, 15 Mar 2023 03:05:34 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.128.87.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Wed, 15 Mar 2023 03:05:34 -0700 (PDT) In-Reply-To: Injection-Info: google-groups.googlegroups.com; posting-host=188.37.72.29; posting-account=3cDqWgoAAAAZXc8D3pDqwa77IryJ2nnY NNTP-Posting-Host: 188.37.72.29 References: User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Use Ada.Containers.Vectors Generic_Sorting or Ada.Containers.Ordered_Sets ? From: Marius Amado-Alves Injection-Date: Wed, 15 Mar 2023 10:05:35 +0000 Content-Type: text/plain; charset="UTF-8" Xref: reader01.eternal-september.org comp.lang.ada:65002 List-Id: > Sometimes, I have to sort records. One possibility is to use Generig_Sorting under Ada.Containers.Vectors and eksplicitly use Sort. An alternative is to use Ada.Containders.Ordered_Sets and somehow get sorting "for free". > > I would like to get arguments for and against these two alternatives. > > reinert Sets have slightly stricter semantics, namely no duplicates. Normally, if the real data has this semantics, you should use sets (and populate with Include or else catch the exception raised upon trying to Insert a duplicate).