TIL `consume` operator to end the lifetime of a variable binding, available from Swift 5.9
TIL consume
operator to end the lifetime of a variable binding, available from Swift 5.9.
Swift proposal consume
operator to end the lifetime of a variable binding.
Does consume
make autoreleasing
redundant?
Swift proposal borrowing
and consuming
parameter ownership modifiers.
That is where the
consume
operator comes into play.consume
consumes the current value of a binding with static lifetime, which is either an unescaped locallet
, unescaped localvar
, or function parameter, with no property wrappers or get/set/read/modify/etc. accessors applied.
What are these local let
and local var
? What is read accessor?