You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
These annotations are necessary to ensure that appropriate `retain`/`release` operations are inserted at the boundary:
1311
+
1312
+
```swift
1313
+
let owned =makeOwnedObject()
1314
+
owned.doSomething()
1315
+
// `owned` is already at +1, so no further retain is needed here
1316
+
1317
+
let unOwned =getUnOwnedObject()
1318
+
// Swift inserts a retain operation on `unowned` here to bring it to +1.
1319
+
unOwned.doSomething()
1320
+
```
1321
+
1322
+
Note that the Swift compiler will automatically infer the ownership conventons for Swift functions returning `SWIFT_SHARED_REFERENCE` types.
1323
+
See [Exposing C++ Shared Reference Types back from Swift](#exposing-c-shared-reference-types-back-from-swift) for calling Swift functions returning `SWIFT_SHARED_REFERENCE` types from C++.
1324
+
1296
1325
### Inheritance and Virtual Member Functions
1297
1326
1298
1327
Similar to value types, casting an instance of a derived reference type to a
0 commit comments