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: "Jeffrey R. Carter" Newsgroups: comp.lang.ada Subject: Re: How to access Vector.Index_Type? Date: Mon, 18 Mar 2019 20:35:32 +0100 Organization: Also freenews.netfront.net; news.tornevall.net; news.eternal-september.org Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Mon, 18 Mar 2019 19:35:32 -0000 (UTC) Injection-Info: reader02.eternal-september.org; posting-host="e9d27cd3fb4b805eef54d5ec832f8f94"; logging-data="18083"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18327zafcL7kV87JgAzP8K2SuByj4Kl8oE=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1 Cancel-Lock: sha1:wnvtp1QT/ZvuJgR62Hi2wHJJanE= In-Reply-To: Content-Language: en-US Xref: reader01.eternal-september.org comp.lang.ada:55889 Date: 2019-03-18T20:35:32+01:00 List-Id: On 3/17/19 9:43 PM, jakub.dabek@gmail.com wrote: > I have the following program > > with Ada.Containers.Vectors; > > procedure Test is > package MyVec is new Ada.Containers.Vectors(Natural, Natural); > Var : MyVec.Index_Type; > begin > null; > end; > > I get the following error: > "Index_Type" is not a visible entity of "MyVec" > > How can I access the index type (`Element_Type` gives the same error message), without just writing `Natural`? This is refreshing. Usually people complain that Ada makes them type too much. It's unusual to see someone complain that Ada makes them type less than they want. If you are dealing with pkg Myvec, Ada presumes that you will look at the instantiation and see that it says Index_Type => Natural and use Natural when you want an index. -- Jeff Carter "What I wouldn't give for a large sock with horse manure in it." Annie Hall 42