SE proposal for borrow/inout reference declarations#1915
SE proposal for borrow/inout reference declarations#1915tbkka wants to merge 3 commits intoswiftlang:mainfrom
Conversation
| * Ongoing work on C++ interoperability and Swift noncopyable | ||
| types will soon allow Swift programs to work with values that | ||
| do not support copying at all. | ||
| Such values cannot easily be used with the existing `let` and |
There was a problem hiding this comment.
I think this line makes it sound like noncopyable types cannot be used with let/var. I wonder if it is possible to loosen the terminology to say that there are usability holes or maybe that there are code patterns we would like to support that one cannot do easily if one just has access to let/var? In my head the issue is not that let/var constructs cannot easily be used with noncopyable types... they can be! It is just the semantics of the type create major restrictions on how one can use let/var and thus make it impossible to express normal code patterns that one would use a let/var to express today? Just some food for thought.
|
@tbkka From your perspective as author, is this ready to run, or should it still be a draft? |
|
@rjmccall The implementation is still very much WIP, but I'm pretty happy with the proposal itself. I would be very pleased to run this and get more detailed feedback, including feedback from the LWG. |
This SE proposal describes a way to add "reference declarations" to the Swift language that would give more fine-grained control over copy and retain/release behavior as well as provide rich functionality for use with noncopyable objects.