I
think that is a bug:
{$mode delphi}
uses
gvector;
type
TFruit=record
name:String;
color:Integer;
end;
type
TFruitList=TVector<TFruit>;
var
flist:TFruitList;
fruit:TFruit = (name:'pear';color:255);// allowed, should also be allowed later.
begin
flist:=TFruitList.Create;
flist.PushBack(Fruit);
// flist.pushback((name:'pear';color:255));// fails, but should be legal syntax
WriteLn(flist[0].name);
flist.Free;
ReadLn;
end.
It is not a bug in gvector. The syntax: (name:'pear';color:255) should be allowed as parameter when the parameter is of type TFruit.
I am almost sure this is
intended to work, but doesn't. It should not even need a cast.
Note that you also made a small syntax error, by using a comma. But that is not really relevant.
Other replies are very welcome.
Note it also fails in Delphi, using a TList<T> for reference.