Hi all,
I'm relatively new to Ada. I have a problem, which seems pretty basic
to me. Thus, I guess you guys have a easy solution ready.
The only thing I want to do is to declare a list package, whose
Element_Type is of a private record type:
package A is
type My_Type is private
package My_Type_Lists is new Ada.Containers.Doubly_Linked_List
(Element_Type => My_Type);
private
type My_Type is
record
....
end record;
end A;
GNAT compiler says, this is a "premature use of private type", which I
accept. However, I don't wanna declare the My_Type_Lists package
elsewhere, which would be a possible solution.
Ideally I wanna use it in some other Package or subprogram like this:
package B is
type Rec_Type is private
package My_Type_Lists is new Ada.Containers.Doubly_Linked_List
(Element_Type => A.My_Type);
-- would be possible, but not very nice
private
type Rec_Type is
record
A_List : A.My_Type_Lists.List;
end record;
So what is the correct way to declare the Container package in package
A?
Thanks in advance,
Alex


|