Search code examples
delphigenericslazarusfpc

FPC TList Specialization not supported


I am using Lazarus 1.0.4 with FPC 2.6

I am trying to create a TList of an own class (I just use string here, because it is more easy), but when I try to use

type
TStringList = specialize TList<string>;

it says "Specialization is only supported for generic types.

What am I doing wrong?


Solution

  • Might as well post it as answer, since it seems to have done the trick.

    You need to use the fgl unit. See the Wiki at freepascal.org.