thanks so much Sven ,
___
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Am 11.05.2015 17:23 schrieb "Sven Barth" :
>
> Am 11.05.2015 16:49 schrieb "misu kun" :
> >
> > thanks
> > in objfpc mode i can imagine this ,but it didn't work unless i
specialize (obj)
> >
> >
> > type
> > generic obj = object
> > x : T;
> > end;
> > operator + (arg1 ,ar
Am 11.05.2015 16:49 schrieb "misu kun" :
>
> thanks
> in objfpc mode i can imagine this ,but it didn't work unless i specialize
(obj)
>
>
> type
> generic obj = object
> x : T;
> end;
> operator + (arg1 ,arg2 : obj):obj; // error : here (obj) needs
specialization
> begin
>
thanks
in objfpc mode i can imagine this ,but it didn't work unless i specialize (obj)
type
generic obj = object
x : T;
end;
operator + (arg1 ,arg2 : obj):obj; // error : here (obj) needs specialization
begin
result.x := arg1.x + arg2.x;
end;
_
On 2015-05-11 14:10, misu kun wrote:
> Hi
> what is the equivalence of this code using mode objfpc ?
> btw , it compile fine with {$mode delphi}
See: http://wiki.freepascal.org/Generics
Also look at the FPC Language Reference documentation for Generics. The
syntax is slightly different to Delph
Hi
what is the equivalence of this code using mode objfpc ?
btw , it compile fine with {$mode delphi}
type
obj = object
x : T;
class operator add (arg1 ,arg2 : obj):obj; inline;
end;
class operator obj.add (arg1 ,arg2 : obj):obj;
begin