on Wed Jul 06 2016, Jacob Bandes-Storch <jtbandes-AT-gmail.com> wrote:
> On Tue, Jul 5, 2016 at 10:50 PM, Dmitri Gribenko via swift-evolution < > [email protected]> wrote: > >> >> > Remove unsafeAddressOf. We are not aware of any real usecases for it. If >> there are any, it should be renamed to unsafeAddress(of:) to follow the >> guidelines. >> Obvious, unless someone comes up with use cases during the review period. >> >> > It's minor, but I use unsafeAddressOf regularly for writing `description` > methods: > > var description: String { > return "<\(self.dynamicType): \(unsafeAddressOf(self))>{ more info > here... }" > } You can do that, but there's no guarantee that the address is meaningful. The compiler is free to copy self into a writeback buffer whose address gets printed. > 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... -- Dave _______________________________________________ swift-evolution mailing list [email protected] https://lists.swift.org/mailman/listinfo/swift-evolution
