From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,1fa85f3df5841ae1 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!news.glorb.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local01.nntp.dca.giganews.com!nntp.megapath.net!news.megapath.net.POSTED!not-for-mail NNTP-Posting-Date: Wed, 27 Apr 2005 19:30:57 -0500 From: "Randy Brukardt" Newsgroups: comp.lang.ada References: <426e4c2b$0$7515$9b4e6d93@newsread2.arcor-online.net> Subject: Re: Ada.Containers.Vectors - querying multiple elements Date: Wed, 27 Apr 2005 19:33:17 -0500 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4927.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4927.1200 Message-ID: NNTP-Posting-Host: 64.32.209.38 X-Trace: sv3-36g7n7704DWgeaM1tjHnBfzwY8hrsdE8gxV6W42oAP9oGhrhDpe6AVq2O9phbNkiQcCENbvB/yud08p!tP2qvrgeL/aiczeKbg0aJ5LQT4z+Q1SpmRUatOgiVDiZU6qlRKNpY6uM7XFr9FTsqufvgJvUtlWm X-Complaints-To: abuse@megapath.net X-DMCA-Complaints-To: abuse@megapath.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.31 Xref: g2news1.google.com comp.lang.ada:10765 Date: 2005-04-27T19:33:17-05:00 List-Id: "Jeffrey Carter" wrote in message news:R_Ebe.13911$lP1.2554@newsread1.news.pas.earthlink.net... ... > Unlike the Vector container that will be part of Ada 0X, this has no > restrictions on the Index subtype. Any discrete type is acceptable. Of course, you did that by having a goofy definition for Last: if Length(S0) = 0, Last(S0) = Index'First. if Length(S1) = 1, Last(S1) = Index'First. I would have preferred to allow any discrete type in Ada.Containers.Vectors, but I lost that battle because the natural instantiation would usually raise Constraint_Error for enumerations and modular types. Other solutions involving lots of special cases are possible, but ultimately, it wasn't thought to be worth it. Enumerations as a Vector index is pretty strange, but modular types seem useful to me. Randy. Randy.