Today, I've discovered new undocumented class operators in the Delphi 10.2 compiler.

Since class operators apply on records, these currently apply on records. But on platforms that support applying class operators on classes, they will apply to classes too.

The new class operators are True, False and OnesComplement, and requires the name of the type it's declared in, as a parameter.
The True and False operators returns a Boolean, while the OnesComplement operator returns the type itself.

  TMyRecord = record
    Value: Integer;
    constructor Create(const AValue: Integer);
    class operator True(const Src: TMyRecord): Boolean;
    class operator False(const Src: TMyRecord): Boolean;
    class operator OnesComplement(const Src: TMyRecord): TMyRecord;

constructor TMyRecord.Create(const AValue: Integer);
  Value := AValue;

class operator TMyRecord.True(const Src: TMyRecord): Boolean;
begin // Test something then... hardcode for now
  Result := Src.Value = 5;

class operator TMyRecord.False(const Src: TMyRecord): Boolean;
begin // Test something, then... hardcode for now
  Result := False;

class operator TMyRecord.OnesComplement(const Src: TMyRecord): TMyRecord;
  Result := Src;

  MyRec: TMyRecord;
  MyRec := TMyRecord.Create(5);
  if MyRec then
    WriteLn('MyRec is true!');

From the above, you can see that you can treat a variable of the type as Boolean.

You can write a statement of the form

if MyTypeName then ...

however, it's not clear why

if not MyTypeName then ...

would produce the error "E2015 Operator not applicable to this operand type".

In addition, the parameter can be declared in 3 ways, decorated with const, var, ie one of the following

const Src: TMyRecord
var Src: TMyRecord
Src: TMyRecord

It's not clear how to invoke the OnesComplement operator, but it might be possible to invoke it in C++ using the ~ operator.

What you can do with them, is simply up to your imagination!