[swift-evolution] 3.0 if-var workaround construction question

Brent Royal-Gordon brent at architechies.com
Fri Dec 18 07:53:24 CST 2015


>     if var testStream = OutputStream(path: aPath) {
>         print("Testing custom output", toStream: &testStream)

What sticks out to me here is, why is OutputStream a value type at all? Does it have some sensible copying behavior? It looks like an OutputStream more or less represents an open file, which seems like a perfect use case for a reference type.

-- 
Brent Royal-Gordon
Architechies



More information about the swift-evolution mailing list