Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

69
Views
Swift 4.2 - __shared attribute near type

https://developer.apple.com/documentation/swift/double?changes=latest_minor In updated version of class definition I found init method for Double with NSNumber near type the unknown keyword __shared. What does it mean?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

The __shared parameter annotation means that a value type parameter can be passed by reference.

For value types, this enables us to elide a copy before we make the call and instead pass a reference pointing right at the memory we allocated. SIL calls this convention in_guaranteed for (indirect reference with guaranteed lifetime). It's currently the way we pass self in non-mutating functions.

It was introduced by the Ownership Manifesto.

Here is the difference between the ownership annotations:

  • inout: mutating pointer-like value
  • __shared: non-mutating pointer-like value
  • __owned: an explicit way of writing the default

Here is a summary of the manifesto: Swift Ownership Manifesto TL;DR.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!