[swift-evolution] [Proposal] Adjusting `inout` Declarations for Type Decoration
jordan_rose at apple.com
Wed Feb 3 13:29:28 CST 2016
> On Feb 3, 2016, at 4:16, Tino Heth via swift-evolution <swift-evolution at swift.org> wrote:
> It's better than the current form — but imho there is alternative that is worth being discussed:
> (inout T) is a type on its own, right? (I guess although everyone seems to avoid the word, it is actually implemented as a pointer ;-)
(inout T) is not a type on its own*, and it is not equivalent to a pointer. If it were, you could have local variables of type "inout T", and you wouldn't be able to use computed properties with inout.
* The compiler represents "inout T" as a distinct type, but it also represents "lvalue T" and "weak T" and "generic T without any bound generic arguments" as types, so it's not really relevant here.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the swift-evolution