`unsafeAddress` and `unsafeMutableAddress`

Thank you for the answer.

A few more questions...

  1. I assume that for ~Copyable that's the only way to implement getters and setters right now?
  2. For types that are Copyable, if for some reason one wants to implement logic that operates "in memory" instead of copying, can these be used too?
  3. Is it possible to have both get and set and unsafeAddress and unsafeMutableAddress for same property (of Copyable type? ). How does it work?

PS: Are these not documented at all? (Comments within the compiler code would be better than nothing). Are they supposed not to be used in code external to the language implementation?

1 Like