[fpc-devel] is not operator

Mattias Gaertner nc-gaertnma at netcologne.de
Fri Sep 11 17:06:25 CEST 2026



On 9/11/26 16:42, Martin Frb via fpc-devel wrote:
 > Never mind, I can't imagine how to fill in the empty bits to make 
this > a useful construct.
 >
> program Project1;
> {$Mode objfpc}
> type
>    TFoo = class end;
>    TFooClass = class of TFoo;
>    TObjClass = class of TObject;
> 
> operator not(o: TFooClass): TObjClass;
> begin
> end;
> 
> var a: TFoo;
> begin
>    writeln(a is not TFoo);
> end.
Fun with operator overloading 😄


Mattias





More information about the fpc-devel mailing list