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
任何幫助表示讚賞。