[swift-evolution] [Proposal] Adjusting `inout` Declarations for Type Decoration

Jordan Rose 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:
> 
> +1
> 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.

Jordan

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160203/88f2b35c/attachment.html>


More information about the swift-evolution mailing list