Some headers still use the `out` keyword when declaring out paramaters of Objective-C methods, e.g. `- (BOOL)setWLANChannel:(CWChannel *)channel error:(out NSError **)error NS_AVAILABLE_MAC(10_7);`
Is there practical difference when this keyword (qualifier?) is present / abscent for ObjC/ObjC++ (ARC / non-ARC), Swift or AppleScript?
The only relevant reference I have found is in Objective-C Automatic Reference Counting doc for Clang, in the section 4.3.4:
4. If the parameter is not an Objective-C method parameter marked
out
, then *p
is read, and the result is written into the temporary with primitive semantics.It's not clear to my why "out" makes such a difference.
Answering my own question: `out` tells the compiler that current value of the retainable object pointer is of no importance to the receiver which allows to elide some retain / release calls. The usecase documented above is actually the only usecase in Apple Clang 11.0.0