On Wed, 2 Feb 2011, Anthony Walter wrote:

By the way, does Free Pascal generic support generic constraints yet? Also,
this format seems more natural to me:

No, it does not.

Michael.


TCollection<T: TCollectionItem> = class
 property Count: Integer;
 property Items[Index: Integer]: T;
end;

TStatusPanels = class(TCollection<TStatusPanel>);

rather than ...

generic TCollection<T> = class // no constrain ability
 property Count: Integer;
 property Items[Index: Integer]: T;
end;

TStatusPanels = specialize TCollection<TStatusPanel>;

_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to