Re: Problem with generic parameter
- From: Marius Amado Alves <amado.alves@xxxxxxxxxx>
- Date: Wed, 22 Jun 2005 15:26:20 +0100
generic type Indices is (<>); package Generic_Root type Measurement is array (Indices) of Measurement;
The reason that I don't do that is that that would have to instantiate a copy of Generic_Root _and_ Generic_Root.Child for each choice of array indices.
No you don't. (The above example was misleading.)
generic
type Indices is (<>);
package Generic_Root.Child_By_Marius is
type Measurement_Array is
array (Indices range <>) of Measurement;
end;with Generic_Root;
with Generic_Root.Child_By_Marius;
procedure Marius_Demo is
type Scalar is digits 15;
package Measurements is
new Generic_Root (Scalar => Scalar);
package Measurements_Text_IO is
new Measurements.Child_By_Marius
(Indices => Positive);
use Measurements_Text_IO; --|
Array_1 : Measurement_Array (1 .. 10); --| *HERE*
Array_2 : Measurement_Array (2 .. 20); --|
begin
null;
end;.
- References:
- Problem with generic parameter
- From: Jacob Sparre Andersen
- Re: Problem with generic parameter
- From: Marius Amado Alves
- Re: Problem with generic parameter
- From: Jacob Sparre Andersen
- Problem with generic parameter
- Prev by Date: Question on use of ! instead of |
- Next by Date: Re: ADA Excel API
- Previous by thread: Re: Problem with generic parameter
- Next by thread: Re: Problem with generic parameter
- Index(es):
Relevant Pages
|
Loading