comp.lang.ada
 help / color / mirror / Atom feed
From: "J-P. Rosen" <rosen@adalog.fr>
Subject: Re: How to access Vector.Index_Type?
Date: Mon, 18 Mar 2019 06:27:10 +0100
Date: 2019-03-18T06:27:10+01:00	[thread overview]
Message-ID: <q6na7f$bjj$1@dont-email.me> (raw)
In-Reply-To: <a0a952ea-0eb7-4129-8c19-87c9f4c7db2d@googlegroups.com>

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

  parent reply	other threads:[~2019-03-18  5:27 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-17 20:43 How to access Vector.Index_Type? jakub.dabek
2019-03-17 21:25 ` Simon Wright
2019-03-18  0:12   ` jakub.dabek
2019-03-18  8:21     ` Simon Wright
2019-03-18  4:17 ` gautier_niouzes
2019-03-18  5:27 ` J-P. Rosen [this message]
2019-03-18  8:31   ` Dmitry A. Kazakov
2019-03-18 20:59     ` briot.emmanuel
2019-03-18 23:01       ` J-P. Rosen
2019-03-18 19:35 ` Jeffrey R. Carter
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox