The construct is possible with 3.0.4 and trunk, but
there is a limitation in the fgl unit. .
Here is an example using fcl-stl and another generic container type:
program untitled;
{$mode objfpc}{$H+}{$I-}
uses glinkedlist;//generics.collections; is also possible from trunk
type
TVec2 = object
end;
TVec2List = specialize TlinkedList < TVec2 >; //generics.collections: Tlist<>
operator = (const A:Tvec2,TVec2 ): Boolean;
begin
Result:= True;
end;
begin
end.
The language supports it since 3.0.4. for anything, records, classes, objects, simple types... Docs are outdated, I think, unless it missed the 3.0.4 release...
Anyway: with trunk even more is possible.