comp.lang.ada
 help / color / mirror / Atom feed
From: Simon Wright <simon@pushface.org>
Subject: Re: How to access Vector.Index_Type?
Date: Sun, 17 Mar 2019 21:25:37 +0000
Date: 2019-03-17T21:25:37+00:00	[thread overview]
Message-ID: <lytvg1tcq6.fsf@pushface.org> (raw)
In-Reply-To: a0a952ea-0eb7-4129-8c19-87c9f4c7db2d@googlegroups.com

jakub.dabek@gmail.com writes:

> 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`?

You could use

   subtype My_Index_Type is MyVec.Extended_Index
     range MyVec.Extended_Index'First + 1 .. MyVec.Extended_Index'Last;


  reply	other threads:[~2019-03-17 21:25 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 [this message]
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
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