[fpc-devel] RTTI interface & variant late binding issue (mORMot)

Sven Barth pascaldragon at googlemail.com
Mon Feb 9 08:14:01 CET 2015


Am 08.02.2015 22:08 schrieb "Maciej Izak" <hnb.code at gmail.com>:
> To achieve this I need to create new special record operators:
>
> ====== code begin ======
> {$MODESWITCH MANAGEMENTOPERATORS}
>
>   TValue = record
>     ...
>     class operator Initialize(Data, TypeInfo: Pointer): pointer;
>     class operator Finalize(Data, TypeInfo: Pointer): pointer;
>     class operator Copy(Source, Dest, TypeInfo: Pointer): pointer;
>   end;
> ====== code end ======

This is /really/ bad design. If you want such operators they would need to
be defined like this:

  TValue = record
    ...
    class operator Initialize(var aRec: TValue);
   class operator Finalize(var aRec: TValue);
    class operator Copy(constref aSource: TValue; var aDest: TValue);
  end;
====== code end ======

Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20150209/8fc22170/attachment.html>


More information about the fpc-devel mailing list