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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: How to access Vector.Index_Type? Date: Mon, 18 Mar 2019 08:21:21 +0000 Organization: A noiseless patient Spider Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: reader02.eternal-september.org; posting-host="08814d7871b503655f366997aa637b9d"; logging-data="731"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/slvVGP8QlrSnHAlYkIyc37D2lAREimgs=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (darwin) Cancel-Lock: sha1:sG35sYepZ/UlBuTgij5tZg4Ttdk= sha1:BjrC/v/3OOS7FD76DMRFjxwKLYs= Xref: reader01.eternal-september.org comp.lang.ada:55887 Date: 2019-03-18T08:21:21+00:00 List-Id: jakub.dabek@gmail.com writes: > Simon Wright writes: >> You could use >> >> subtype My_Index_Type is MyVec.Extended_Index >> range MyVec.Extended_Index'First + 1 .. MyVec.Extended_Index'Last; > > > This feels more like a "life-hack", requiring the knowledge of > internal representation of `Extended_Index`. Is there really no better > way to do that? Well, as J-P Rosen has said, why would you ever need to do this in the first place? But, anyway, it's not an internal repreentation, it's public in ARM A.18.2(7): http://www.ada-auth.org/standards/rm12_w_tc1/html/RM-A-18-2.html#p7