Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

70
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda