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: "J-P. Rosen" Newsgroups: comp.lang.ada Subject: Re: How to access Vector.Index_Type? Date: Mon, 18 Mar 2019 06:27:10 +0100 Organization: Adalog Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Mon, 18 Mar 2019 05:27:11 -0000 (UTC) Injection-Info: reader02.eternal-september.org; posting-host="9aeb5bf694498952af5f141b2f7cbd1b"; logging-data="11891"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+73vUsjOu+6FgIPm+hd2eS" User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.5.3 Cancel-Lock: sha1:uFtDNG85ZaHd8+x/TnHkEVZduyA= In-Reply-To: Content-Language: fr Xref: reader01.eternal-september.org comp.lang.ada:55886 Date: 2019-03-18T06:27:10+01:00 List-Id: Le 17/03/2019 à 21:43, jakub.dabek@gmail.com a écrit : > 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`? > Why would you do that? If you instantiate Vectors on Natural, it's because you want a vector of Natural! Therefore it makes sense to use Natural. The name "Index_Type" is a formal, not an actual type, it's just the package's business. -- J-P. Rosen Adalog 2 rue du Docteur Lombard, 92441 Issy-les-Moulineaux CEDEX Tel: +33 1 45 29 21 52, Fax: +33 1 45 29 25 00 http://www.adalog.fr