1
我有一个名为Linked_List(.ads)封装下面是它的代码:无法理解泛型是如何工作的
Generic
type T is private;
package Linked_List is
type List is tagged record
Data : T;
end record;
end Linked_List;
,这里是其中包含的主要功能(主要包装上的代码。 ADB)
with Ada.Text_IO; use Ada.Text_IO;
with Linked_List;
procedure Main is
type ListOfIntegers is new Linked_List(T => Integer);
begin
null;
end Main;
我得到这个错误:
4:30 subtype mark required in this context
found "Linked_List" declared at linked_list.ads:3
found "Linked_List" declared at linked_list.ads:3
4:41 incorrect constrain for this kind of type
任何帮助表示赞赏。