Jump to content

Cristian Peța

Members
  • Content Count

    344
  • Joined

  • Last visited

  • Days Won

    4

Posts posted by Cristian Peța


  1. What if we would have [safe] attribute?

    It would be very useful for local instances. 

     

    We have [unsafe] attribute but not [safe]. In ARC all instances are implicitly [safe] and we need to explicitly mark with [unsafe] if we don't want ARC.

    I call this implicit ARC.

     

    But with [safe] we can have explicit ARC where all instances are implicit [unsafe].

     

     

    var ms := TStringList.Create;
    try
      ...
    finally
      ms.Free;
    end;
    var [safe] ms := TStringList.Create;
    ...

    Merged by Sherlock: Try to avoid double posts, please.

    • Like 1
×