Skip to content

Conversation

@przybylski
Copy link
Contributor

This code uses some c++ trickery to make defer macro looks almost like defer keyword in swift.

Instad of:

defer([&]() {
  /* cleanup code */
});

coders can now drop some boilerplate and do this:

defer {
  /* cleanup code */
};

But this changes capture list to all values by reference

@nadavrot
Copy link
Contributor

nadavrot commented Dec 4, 2015

@przybylski , please find the author of this code (using git blame) and invite them to review this code (by using their github handle name)

@przybylski
Copy link
Contributor Author

@lattner could you have a look on this PR?

@jckarter
Copy link
Contributor

jckarter commented Dec 4, 2015

I prefer the function to macro trickery, honestly. Neat trick though.

lattner added a commit that referenced this pull request Dec 6, 2015
Make c++ defer looks like a swift one
@lattner lattner merged commit 82a0067 into swiftlang:master Dec 6, 2015
@lattner
Copy link
Contributor

lattner commented Dec 6, 2015

Simultaneously cute and horrible :-) - looks great, thanks!

slavapestov pushed a commit to slavapestov/swift that referenced this pull request Nov 27, 2018
handle EWOULDBLOCK error in _dispatch_operation_perform
slavapestov pushed a commit to slavapestov/swift that referenced this pull request Nov 27, 2018
handle EWOULDBLOCK error in _dispatch_operation_perform

Signed-off-by: Daniel A. Steffen <[email protected]>
dabelknap pushed a commit to dabelknap/swift that referenced this pull request Dec 5, 2018
maldahleh pushed a commit to maldahleh/swift that referenced this pull request Oct 26, 2020
Add a change log describing the changes since the Swift 5.1 release
freak4pc pushed a commit to freak4pc/swift that referenced this pull request Sep 28, 2022
DougGregor pushed a commit to DougGregor/swift that referenced this pull request Apr 28, 2024
…Targett-to-SignBundle

Add DependsOnTargets to SignBundle insignia target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants