[fpc-pascal] Interface syntax: Is possible don't use specialize in mode objfpc?

Marcos Douglas md at delfire.net
Thu Jul 16 15:34:17 CEST 2015


Hi,

Is there some way to write this:
type
  generic ICloneable<T> = interface
    function Clone: T;
  end;

...using this sintaxe:
type
  ICloneable<T> = interface
    function Clone: T;
  end;

Because I would like to use:
TFoo = class(ICloneable<TFoo>)

...instead use:
TFoo = class(specialize ICloneable<TFoo>)

But using {$mode objfpc}, ie, if exists some compiler directive to
change only this syntax, that is the same in Delphi.

I would like to know why exists this difference, what the advantages
for mode objfpc using this syntax.

Thank you very much.


Marcos Douglas



More information about the fpc-pascal mailing list