[Lazarus] FPC 3.0.0-rc2 release

Anthony Walter sysrpl at gmail.com
Fri Nov 20 15:25:35 CET 2015


Maciej, perhaps define a generic contain class in the Sparta package. That
is, copy some code from Generic.Collections and type alias it, and Wrap
that code in ifdefs.

unit Sparta.Generics.Collections;

interface

{$if fpc_fullversion < 30100}
uses
Classes;

{ Copy type the generic declaration Generics.Collections }

type
   TList<T> = class(TEnumerable<T>)
   end;

{$else}
uses
Classes, Generics.Collections;
{$endif}

type
  TGenericList<T> = TList<T>;

implmentation

{$if fpc_fullversion < 30100}
{ Implement TList<T> here}
{$endif}

end.

Then use  Sparta.Generics.Collections and TGenericList<T> in the rest of
your code.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20151120/bc2581ab/attachment-0003.html>


More information about the Lazarus mailing list