on Thu Jul 07 2016, Dave Abrahams <[email protected]> wrote: > on Wed Jul 06 2016, Jacob Bandes-Storch <[email protected]> wrote: > >>> * *Remove unsafeAddressOf*. "We are not aware of any real use cases for >>> it. If there are any, it should be renamed to unsafeAddress(of:) to follow >>> the guidelines." (https://bugs.swift.org/browse/SR-1957 >>> rdar://problem/18589289) >>> >>> >> Oops, I just responded to this on another thread. Pasting: >> >> It's minor, but I use unsafeAddressOf regularly for writing `description` >> methods: >> >> var description: String { >> return "<\(self.dynamicType): \(unsafeAddressOf(self))>{ more info >> here... }" >> } >> >> I guess this would be covered by some generalized solution for format >> specifiers in string interpolations, but I gather that won't happen for >> quite a while... > > If we remove unsafeAddressOf, we have no way to get the address of an > immutable variable. I take it back; we already have no way to do that. unsafeAddressOf, since it only applies to AnyObject, is totally dispensable. Today you can do: Unmanaged.passUnretained(x).toOpaque() -- Dave _______________________________________________ swift-evolution mailing list [email protected] https://lists.swift.org/mailman/listinfo/swift-evolution
Re: [swift-evolution] [Discussion] Cleaning up stdlib pointer and buffer routines (Open Issues Affecting Standard Library API Stability)
Dave Abrahams via swift-evolution Fri, 08 Jul 2016 16:27:49 -0700
- Re: [swift-evolution] [Discussion]... Charlie Monroe via swift-evolution
- Re: [swift-evolution] [Discus... Erica Sadun via swift-evolution
- Re: [swift-evolution] [Discussion]... Jacob Bandes-Storch via swift-evolution
- Re: [swift-evolution] [Discus... Jordan Rose via swift-evolution
- Re: [swift-evolution] [Di... Charlie Monroe via swift-evolution
- Re: [swift-evolution]... Dmitri Gribenko via swift-evolution
- Re: [swift-evolut... Jordan Rose via swift-evolution
- Re: [swift-evolution] [Discus... Charlie Monroe via swift-evolution
- Re: [swift-evolution] [Discus... Dave Abrahams via swift-evolution
- Re: [swift-evolution] [Di... Charlie Monroe via swift-evolution
- Re: [swift-evolution] [Di... Dave Abrahams via swift-evolution
