[fpc-pascal] Managed properties idea

Maciej Izak hnb.code at gmail.com
Mon Oct 9 10:24:44 CEST 2017


2017-10-07 2:10 GMT+02:00 Michalis Kamburelis <michalis.kambi at gmail.com>:

> Your TSmartObj is, well, exactly what I want:) As long as you pass
> around only "TSmartObj<TSomeObject1>" (and don't create cycles :) ),
> you're perfectly safe and leak-free.
>

Probably management operators idea will be expanded by new operators Clone
& Assign (names are still debatable), still some research is needed for new
operators for multi-threaded aspect:

(see Eric Grange comments)
https://plus.google.com/u/0/115782878581272923715/posts/ETUoFXtoAYX

mORMot framework has also nice solution for "auto free" (solution uses
interfaces too):

===code begin===
  with TAutoFree.One(o, TObject.Create) do
  begin
    ...
    Another(o2, TObject.Create);
    ...
  end;

  with TAutoFree.Several([
    o, TObject.Create,
    f, TFoo.Create,
    sl, TStringList.Create])
  do
  begin
    ...
  end;
===code end===

somehow similar in usage like "using" from C#

-- 
Best regards,
Maciej Izak
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20171009/02f5238e/attachment.html>


More information about the fpc-pascal mailing list