green1229.tistory.com

[SE-0519] Borrow and Inout types for safe, first-class references (opens in new tab)

안녕하세요. 그린입니다 이번 포스팅에서는 안전한 first-class 참조를 위한 Borrow와 Inout 타입에 대해 정리해보겠습니다 Intro Proposal: SE-0519 Authors: Joe Groff, Alejandro Alonso Status: Active review (March 4...17, 2026) Motivation Swift는 함수 호출의 일부로 값에 대한 임시 접근을 제공할 수 있습니다. inout 파라미터: 호출자가 소유한 값에 대한 임시 독점(exclusive) 접근을 받습니다. 호출된 쪽에서 파라미터를 수정하거나 현재 값을 소비(consume)할 수 있고, 호출자는 함수가 반환되면 소유권을 다시 가져옵니다. borrowing 파라미터: 호출자로부터 값에 대한 임시 공유(shared) 접근을 받습니다. 다른 곳에서도 동시에 접근할 수 있으므로 일반적으로 값을 읽기만 할 수 있지만, 독립적인 복사본 없이도 접근이 가능합니다. 이런 종류의 참조를 함수...

Read the original article
Sign in to keep reading the full article.

Keyboard Shortcuts

Navigation

Next / previous post
j/k
Open post
oorEnter
Preview post
v

Post Actions

Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Save / unsave
s

Recommendations

Add interest / feed
Enter
Not interested
x

Go to

Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Discover
gb
Search
/

General

Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help