fpc 3.2.2可以使用delphi的泛型,需要在单元添加:
{$mode delphi}
,并在uses 加上Generics.Collections后才能编译
program project1; //{$mode objfpc}{$H+} {$mode delphi}{$H+} uses Generics.Collections; var d:TDictionary<byte,byte>; i:byte; begin d:=TDictionary<byte,byte>.create; d.tryadd(3,4); if d.trygetvalue(3,i) then writeln(i); d.free; end.
标签:delphi,Collections,mode,Generics,泛型,uses,freepascal From: https://www.cnblogs.com/qiufeng2014/p/17026529.html